24 namespace Ntp.Analyzer.Objects
35 var adjusted =
new DateTime(
36 time.Year, time.Month, time.Day,
37 time.Hour, time.Minute, time.Second,
40 Time = adjusted.AddMinutes(zone);
49 Time = bulk?.
Time ?? DateTime.UtcNow;
55 public DateTime Time {
get; }
57 public DateTime UtcTime
63 case DateTimeKind.Utc:
64 case DateTimeKind.Unspecified:
66 case DateTimeKind.Local:
67 return Time.Subtract(TimeZoneInfo.Local.GetUtcOffset(DateTime.UtcNow));
74 public DateTime LocalTime
80 case DateTimeKind.Utc:
81 case DateTimeKind.Unspecified:
82 return UtcTime.Add(TimeZoneInfo.Local.GetUtcOffset(DateTime.UtcNow));
83 case DateTimeKind.Local:
86 return UtcTime.Add(TimeZoneInfo.Local.GetUtcOffset(DateTime.UtcNow));
97 case DateTimeKind.Utc:
98 case DateTimeKind.Unspecified:
100 case DateTimeKind.Local:
101 return Convert.ToInt32(TimeZoneInfo.Local.GetUtcOffset(DateTime.UtcNow).TotalMinutes);
108 public DateTime RoundedUtcTime =>
new DateTime(
109 UtcTime.Year, UtcTime.Month, UtcTime.Day,
110 UtcTime.Hour, UtcTime.Minute, 0,
113 public DateTime RoundedLocalTime =>
new DateTime(
114 LocalTime.Year, LocalTime.Month, LocalTime.Day,
115 LocalTime.Hour, LocalTime.Minute, 0,
Reading(int id, DateTime time, int zone, Host host)
Reading(Host host, ReadingBulk bulk)