Browse Source

Use new API `from_nanoseconds` in `uuid`

Feoramund 1 year ago
parent
commit
ca58d7771b
1 changed files with 3 additions and 3 deletions
  1. 3 3
      core/encoding/uuid/reading.odin

+ 3 - 3
core/encoding/uuid/reading.odin

@@ -163,7 +163,7 @@ Returns:
 - timestamp: The timestamp of the UUID.
 - timestamp: The timestamp of the UUID.
 */
 */
 time_v1 :: proc "contextless" (id: Identifier) -> (timestamp: time.Time) {
 time_v1 :: proc "contextless" (id: Identifier) -> (timestamp: time.Time) {
-	return { _nsec = cast(i64)(raw_time_v1(id) - HNS_INTERVALS_BETWEEN_GREG_AND_UNIX) * 100 }
+	return time.from_nanoseconds(cast(i64)(raw_time_v1(id) - HNS_INTERVALS_BETWEEN_GREG_AND_UNIX) * 100)
 }
 }
 
 
 /*
 /*
@@ -194,7 +194,7 @@ Returns:
 - timestamp: The timestamp, in 100-nanosecond intervals since 1582-10-15.
 - timestamp: The timestamp, in 100-nanosecond intervals since 1582-10-15.
 */
 */
 time_v6 :: proc "contextless" (id: Identifier) -> (timestamp: time.Time) {
 time_v6 :: proc "contextless" (id: Identifier) -> (timestamp: time.Time) {
-	return { _nsec = cast(i64)(raw_time_v6(id) - HNS_INTERVALS_BETWEEN_GREG_AND_UNIX) * 100 }
+	return time.from_nanoseconds(cast(i64)(raw_time_v6(id) - HNS_INTERVALS_BETWEEN_GREG_AND_UNIX) * 100)
 }
 }
 
 
 /*
 /*
@@ -221,7 +221,7 @@ Returns:
 - timestamp: The timestamp, in milliseconds since the UNIX epoch.
 - timestamp: The timestamp, in milliseconds since the UNIX epoch.
 */
 */
 time_v7 :: proc "contextless" (id: Identifier) -> (timestamp: time.Time) {
 time_v7 :: proc "contextless" (id: Identifier) -> (timestamp: time.Time) {
-	return { _nsec = cast(i64)raw_time_v7(id) * 1e6 }
+	return time.from_nanoseconds(cast(i64)raw_time_v7(id) * 1e6)
 }
 }
 
 
 /*
 /*