aboutsummaryrefslogtreecommitdiff
path: root/test/01-native.janet
diff options
context:
space:
mode:
authorChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-05-12 16:53:08 -0400
committerChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-05-12 16:53:08 -0400
commit2d2617b63706b8781418565330d23449701b3a71 (patch)
treed23b163114289f7a5d4bed749b916603f244319e /test/01-native.janet
parentinvestigating... (diff)
big updates
ok I figured out what the problem was, I think? put is nice too now, no more conversions eh also offsets are nice, makes iterating way easier
Diffstat (limited to '')
-rw-r--r--test/01-native.janet17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/01-native.janet b/test/01-native.janet
new file mode 100644
index 0000000..442a651
--- /dev/null
+++ b/test/01-native.janet
@@ -0,0 +1,17 @@
+(use date/native)
+
+# you always start with this
+# `time` returns the time in UTC
+(def now (time))
+
+# if you want to modify the time, you should use localtime, like so
+(def lt (:localtime now))
+(update lt :sec |(+ $ 2000))
+(update lt :year |(- $ 10))
+
+(def gt (:gmtime now))
+(put gt :sec 13)
+
+(pp now)
+(pp lt)
+(pp gt)