Created
September 29, 2022 05:55
-
-
Save rotaliator/4c5537b4a993259a033386e86d5e7607 to your computer and use it in GitHub Desktop.
Get current time as string with pattern
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 now-with-pattern | |
"Returns current time as string with pattern" | |
[pattern] | |
(.format (java.time.LocalDateTime/now) (java.time.format.DateTimeFormatter/ofPattern pattern))) | |
(now-with-pattern "yyyyMMddHHmmss") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment