our/cmds/jikan

18 lines
441 B
Plaintext
Executable File
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/usr/bin/env hy3
(import [datetime [datetime]])
(setv fullwidth (str.maketrans
(dfor [i ch] (enumerate "") [(str i) ch])))
(setv weekdays "日月火水木金土") (comment 曜日)
(defn ctime []
(setv d (datetime.now))
(-> (.format "{}年{}月{}日 {:02d}{:02d}{:02d}"
d.year d.month d.day d.hour d.minute d.second)
(.translate fullwidth)))
(print (ctime))