aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/ledger/UUIDUtil.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger/UUIDUtil.kt')
-rw-r--r--src/main/kotlin/moe/nea/ledger/UUIDUtil.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/UUIDUtil.kt b/src/main/kotlin/moe/nea/ledger/UUIDUtil.kt
index ddfb8c2..5549908 100644
--- a/src/main/kotlin/moe/nea/ledger/UUIDUtil.kt
+++ b/src/main/kotlin/moe/nea/ledger/UUIDUtil.kt
@@ -12,6 +12,10 @@ object UUIDUtil {
value class ULIDWrapper(
val wrapped: String
) {
+ fun getTimestamp(): Instant {
+ return Instant.ofEpochMilli(ULID.getTimestamp(wrapped))
+ }
+
init {
require(ULID.isValid(wrapped))
}