What Time Is It? - How Service Manager Stores Date and Time

Author by Christopher Mank

One of the great things about Service Manager is its out-of-box capability to be configured in many different languages.  With things like Language Codes and Display Strings in Management Packs, we can configure Service Manager to be a completely global/multi-lingual system.  To account for this, the data has to be flexible enough to display consistently regardless of a console opened in Germany or the portal opened in the U.S. One the most important data elements that need to be consistent are dates and times.  Fortunately for us, all dates and times in the Service Manager database are stored in UTC format.  Let's take a look at an example. Being in the lovely state of Wisconsin, we live in the (UTC-06:00) Central Time (US & Canada) time zone.  During Daylight Saving Time, the offset is actually UTC-05:00.  Let's use an Incident for our example. As you can see, IR 6160 has a Created Date of 5/9/2013 10:31:19PM.  That is the actual time (in Central Daylight Time) I opened the Incident. SCSM Incident Created Date Image   If we look at the DWDataMart DB, we will see that date stored as UTC (Since our offset is -5:00, to get to UTC, we would need to add the 5:00 back in, thus making the new time 5/10/2013 03:31:19AM SCSM Incident Created DW Image   And we also see this same date in the operational CMDB. SCSM Incident Created CMDB Image   So how come you don't see this time in the console? The Service Manager console is programmed in such a way that when you view any dates or times, they are converted to the correct time zone of the machine from which you are viewing the data.  So if you have a console opened in sunny Bell, California, it will look at the UTC offset (which in that case is -08:00) and covert it properly in the UI.  Pretty cool huh? So why do we care?  This really comes into play as you start to create/configure Orchestrator automations, PowerShell scripts, custom reports and my favorite, the CSV import. I like to use the CSV import to either create/update some custom properties being synced over in a custom connector or to bulk import data from another system during a migration. Either way, all times in Service Manager are stored in UTC format, even in the CSV import. So if you wanted to import the date 01/01/2013 12:00:00 into your database and had a line in your CSV that said 01/01/2013 12:00:00 (or even just 01/01/2013 for that matter), it will interpret that as already being in UTC time.  So when you open it up in the console (and your offset is -06:00 for example), the date will actually read 12/31/2012 6:00:00PM. I hope this helps anyone curious about why dates and times are stored the way they are.   Until the Whole World Hears, Christopher


Christopher Mank

Systems Architect