our/cmds/jikan

18 lines
441 B
Plaintext
Raw Permalink Normal View History

2022-08-24 02:40:36 +00:00
#!/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))