Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/Common/CommonTypes.h (1 of 28 files). Show all
Unified · Split
| @@ -48,6 +48,9 @@ namespace GSF · 47 unmodified lines | ||
| 48 | 48 | typedef double_t float64_t; |
| 49 | 49 | typedef boost::multiprecision::cpp_dec_float_100 decimal_t; |
| 50 | 50 | |
| 51 | + // DateTime type | |
| 52 | + typedef boost::posix_time::ptime datetime_t; | |
| 53 | + | |
| 51 | 54 | struct Int8 |
| 52 | 55 | { |
| 53 | 56 | static const int8_t MaxValue = static_cast<int8_t>(127); |
| @@ -105,16 +108,26 @@ namespace GSF · 51 unmodified lines | ||
| 105 | 108 | static const decimal_t DotNetMinValue; |
| 106 | 109 | }; |
| 107 | 110 | |
| 111 | + struct DateTime | |
| 112 | + { | |
| 113 | + static const datetime_t MaxValue; | |
| 114 | + static const datetime_t MinValue; | |
| 115 | + }; | |
| 116 | + | |
| 108 | 117 | struct Ticks |
| 109 | 118 | { |
| 119 | + static const int64_t MaxValue = 3155378975999999999L; // 12/31/1999 11:59:59.999 | |
| 120 | + static const int64_t MinValue = 0L; // 01/01/0001 00:00:00.000 | |
| 121 | + | |
| 122 | + static const int64_t UnixBaseOffset = 621355968000000000L; // 01/01/1970 00:00:00.000 | |
| 123 | + static const int64_t PTimeBaseOffset = 441481536000000000L; // 01/01/1400 00:00:00.000 | |
| 124 | + | |
| 110 | 125 | static const int64_t PerSecond = 10000000L; |
| 111 | 126 | static const int64_t PerMillisecond = Ticks::PerSecond / 1000; |
| 112 | 127 | static const int64_t PerMicrosecond = Ticks::PerSecond / 1000000; |
| 113 | 128 | static const int64_t PerMinute = 60L * Ticks::PerSecond; |
| 114 | 129 | static const int64_t PerHour = 60L * Ticks::PerMinute; |
| 115 | 130 | static const int64_t PerDay = 24L * Ticks::PerHour; |
| 116 | − static const int64_t UnixBaseOffset = 621355968000000000L; // 01/01/1970 00:00:00 | |
| 117 | − static const int64_t PtimeBaseOffset = 441481536000000000L; // 01/01/1400 00:00:00 | |
| 118 | 131 | }; |
| 119 | 132 | |
| 120 | 133 | template<class T> |
| @@ -167,7 +180,6 @@ namespace GSF · 46 unmodified lines | ||
| 167 | 180 | |
| 168 | 181 | typedef boost::any Object; |
| 169 | 182 | typedef boost::uuids::uuid Guid; |
| 170 | − typedef boost::posix_time::ptime DateTime; | |
| 171 | 183 | typedef boost::posix_time::time_duration TimeSpan; |
| 172 | 184 | typedef boost::system::error_code ErrorCode; |
| 173 | 185 | typedef boost::system::system_error SystemError; |
| @@ -192,7 +204,7 @@ namespace GSF · 18 unmodified lines | ||
| 192 | 204 | struct Empty |
| 193 | 205 | { |
| 194 | 206 | static const std::string String; |
| 195 | − static const GSF::DateTime DateTime; | |
| 207 | + static const GSF::datetime_t DateTime; | |
| 196 | 208 | static const GSF::Guid Guid; |
| 197 | 209 | static const GSF::Object Object; |
| 198 | 210 | static const GSF::IPAddress IPAddress; |
| @@ -394,11 +406,11 @@ namespace GSF · 195 unmodified lines | ||
| 394 | 406 | Millisecond |
| 395 | 407 | }; |
| 396 | 408 | |
| 397 | − DateTime DateAdd(const DateTime& value, int32_t addValue, TimeInterval interval); | |
| 398 | − int32_t DateDiff(const DateTime& startTime, const DateTime& endTime, TimeInterval interval); | |
| 399 | − int32_t DatePart(const DateTime& value, TimeInterval interval); | |
| 400 | − DateTime Now(); | |
| 401 | − DateTime UtcNow(); | |
| 409 | + datetime_t DateAdd(const datetime_t& value, int32_t addValue, TimeInterval interval); | |
| 410 | + int32_t DateDiff(const datetime_t& startTime, const datetime_t& endTime, TimeInterval interval); | |
| 411 | + int32_t DatePart(const datetime_t& value, TimeInterval interval); | |
| 412 | + datetime_t Now(); | |
| 413 | + datetime_t UtcNow(); | |
| 402 | 414 | } |
| 403 | 415 | |
| 404 | 416 | // Setup standard hash code for Guid |