Created
February 4, 2018 23:27
-
-
Save saralilyb/8c9ec879bb47b75647d6ef3a16472426 to your computer and use it in GitHub Desktop.
makes an iso8601 timestamp using JUST CLOJURE WITHOUT SEVEN THOUSAND LIBRARIES COME ON KIDS LEARN HOW TO USE WHAT YOU HAVE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn maketimestamp | |
"makes iso8601 timestamp manually | |
(works pre java 8) | |
from https://stackoverflow.com/questions/3914404/how-to-get-current-moment-in-iso-8601-format-with-date-hour-and-minute" | |
[] | |
(let [tz (java.util.TimeZone/getTimeZone "UTC") | |
df (new java.text.SimpleDateFormat "yyyy-MM-dd'T'HH:mm:ss'Z'")] | |
(.setTimeZone df tz) | |
(.format df (new java.util.Date)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can also do