JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in
# due to 0 indexing, you will often want to add 1 to things: (defn short-date [d] (let [{:year y :month mon :month-day d} d] (string y "-" (+ 1 mon) "-" (+ 1 d)))) # Makes os/date like 2025-12-25 (short-date (os//date)) # From: https://codeberg.org/veqq/deforester/src/branch/master/deforester.janet (defn time-string ``Gives current time as ISO 8601 string: 2025-10-12T11:43:14 https://en.wikipedia.org/wiki/ISO_8601 This accounts for `os/date` 0-indexing month and days which are 1-indexed in ISO 8601.`` [] (let [{:year y :month mon :month-day d :hours h :minutes min :seconds s} (os/date)] (string y "-" (+ 1 mon) "-" (+ 1 d) "T" h ":" min ":" s)))