什么格式是在这个时间值?是在、格式、时间

2023-09-02 10:51:21 作者:ー個亽遠行

我有一个WMI查询,指定此格式20090219000000.000000 + 480

I have a WMI query that specifies time in this format '20090219000000.000000+480'

谁能告诉我是什么格式,这是和.NET是否有任何内置的功能与它的工作?

Can someone tell me what format this is, and does .NET have any built-in functionality to work with it?

修改

这个时间值是,我发现了一个简单的查询。我不知道什么时间值用于生成它。我只需要能够将时间值转换为这种格式。

This time value is from a sample query that I found. I don't know what time value was used to generate it. I just need to be able to convert a time value to this format.

编辑2

我发现这一次是在 CIM_DATETIME 的格式。

I found out this time is in CIM_DATETIME format.

推荐答案

这看起来像没有任何分隔符标准的日期时间字符串:

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

20090219000000.000000 + 480

'20090219000000.000000+480'

yyyyMMddhhmmss.ffffff + 480

'yyyyMMddhhmmss.ffffff+480'

YYYY - 四位数年份。 MM - 数字月份。一位数的月份有一个前导零。 DD - 这个月的一天。一位数的日期有一个前导零。 HH - 在一个12小时制的小时。一位数的小时数有前导零。 (这也可能是HH,这是小时在24小时制时钟具有前导零的个位数小时。) 毫米 - 分钟。单数的分钟数有一个前导零。 FFFFFF - 六位precision第二的分数。

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.

在+480是最有可能的一个时区的指标,虽然不是一个标准。通常的时区从UTC重新psented为小时(或小时和分钟)$ P $。这似乎可能只有几分钟。因此,没有标准的格式说明。

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.

DateTime类的.NET是你会用什么与该值继续工作。然而,你可能会想解析剩下的字符串中的实际日期时间变量之前采取了+480部分关闭。然后,您可以把它调整到正确的时区或执行时间提前的时区转换(从几分钟到几小时/分钟),改变+480,以正确的时区重presentation,然后通过整个事情的日期时间。解析。

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.

 
精彩推荐
图片推荐