diff options
| author | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-06-22 17:58:42 -0400 |
|---|---|---|
| committer | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-06-22 18:21:32 -0400 |
| commit | 8a4a3ed66e9fc2e4ecc398acb616a6c3b756515e (patch) | |
| tree | 5940668acca54ab02cf4827cb1fb106e9ffca4aa /core/encoding | |
| parent | 4481f9c695061782f8ff086fc13c58f13ab43023 (diff) | |
Change how `Time` is constructed in `uuid`
Diffstat (limited to 'core/encoding')
| -rw-r--r-- | core/encoding/uuid/reading.odin | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/encoding/uuid/reading.odin b/core/encoding/uuid/reading.odin index d41606f63..ab08300b0 100644 --- a/core/encoding/uuid/reading.odin +++ b/core/encoding/uuid/reading.odin @@ -163,8 +163,7 @@ Returns: - timestamp: The timestamp of the UUID. */ time_v1 :: proc "contextless" (id: Identifier) -> (timestamp: time.Time) { - delta := cast(time.Duration)(raw_time_v1(id) - HNS_INTERVALS_BETWEEN_GREG_AND_UNIX) * 100 - return time.time_add({}, delta) + return { _nsec = cast(i64)(raw_time_v1(id) - HNS_INTERVALS_BETWEEN_GREG_AND_UNIX) * 100 } } /* @@ -195,8 +194,7 @@ Returns: - timestamp: The timestamp, in 100-nanosecond intervals since 1582-10-15. */ time_v6 :: proc "contextless" (id: Identifier) -> (timestamp: time.Time) { - delta := cast(time.Duration)(raw_time_v6(id) - HNS_INTERVALS_BETWEEN_GREG_AND_UNIX) * 100 - return time.time_add({}, delta) + return { _nsec = cast(i64)(raw_time_v6(id) - HNS_INTERVALS_BETWEEN_GREG_AND_UNIX) * 100 } } /* @@ -223,7 +221,7 @@ Returns: - timestamp: The timestamp, in milliseconds since the UNIX epoch. */ time_v7 :: proc "contextless" (id: Identifier) -> (timestamp: time.Time) { - return time.time_add({}, cast(time.Duration)(raw_time_v7(id) * 1e6)) + return { _nsec = cast(i64)raw_time_v7(id) * 1e6 } } /* |