зеркало из https://github.com/microsoft/Tx.git
TimeUtil.cs add public static property DateTimeKind defaulted to current value DateTimeKind.Local to allow parsing of .blg from different timezone (#65)
* Update Build.cmd * Update Build.cmd * Update Build.cmd * TimeUtil.cs add static DateTimeKind option defaulted to DateTimeKind.Local. This allows the parsing of a performance counter file created in a different timezone. For performance counter files in azure (utc), setting DateTimeKind.Utc.
This commit is contained in:
Родитель
1902666bbb
Коммит
1171765138
|
@ -4,10 +4,11 @@ using System;
|
|||
|
||||
namespace Tx.Windows
|
||||
{
|
||||
// We implemented this in Tx, because the default .Net implementation was too slow
|
||||
// We should do experiment if we still need it
|
||||
public sealed class TimeUtil
|
||||
{
|
||||
// DateTimeKind option needed for overriding DateTimeKind if parsing
|
||||
// performance counter blg from different timezone than creation time zone
|
||||
public static DateTimeKind DateTimeKind {get; set;} = DateTimeKind.Local;
|
||||
private const Int64 TicksPerMillisecond = 10000;
|
||||
private const Int64 TicksPerSecond = TicksPerMillisecond * 1000;
|
||||
private const Int64 TicksPerMinute = TicksPerSecond * 60;
|
||||
|
@ -35,7 +36,7 @@ namespace Tx.Windows
|
|||
|
||||
public static DateTime FromFileTime(Int64 fileTime)
|
||||
{
|
||||
return new DateTime(FileTimeOffset + fileTime, DateTimeKind.Local);
|
||||
return new DateTime(FileTimeOffset + fileTime, DateTimeKind);
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче