What format is this time value in?

This looks like a standard date time string without any separators:

'20090219000000.000000+480'

'yyyyMMddhhmmss.ffffff+480'

yyyy - The year in four digits.
MM - The numeric month. Single-digit months have a leading zero.
dd - The day of the month. Single-digit days have a leading zero.
hh - The hour in a 12-hour clock. Single-digit hours have a leading zero. (This could also be HH, which is the hour in a 24-hour clock with single-digit hours having a leading zero.)
mm - The minute. Single-digit minutes have a leading zero.
ffffff - The fraction of a second in six-digit precision.

The "+480" is most likely a timezone indicator, although not a standard one. Normally time zones are represented as hours (or hours and minutes) from UTC. This appears to probably only be minutes. As such, there is no standard format specifier.

The DateTime class in .NET is what you would use to work with this value. However, you would probably want to take the "+480" portion off before parsing the remaining string in to an actual DateTime variable. You can then adjust it to the correct timezone or perform the timezone conversion (from minutes to hours/minutes) ahead of time and change the "+480" to the correct timezone representation and then pass the whole thing to DateTime.Parse.


As others have suggested the string is an example of DATETIME MOF data type. It is a fixed-length string and you can find details about its structure here. .Net uses System.Management namespace to access WMI and one of its classes is ManagementDateTimeConverter class which facilitates working with WMI datetime values.

Here is how you use all this:

var time_written = System.Management.ManagementDateTimeConverter.ToDateTime((string)result.GetPropertyValue("TimeWritten"));