# Due to: https://github.com/swlkr/janetdocs/issues/50
(defn parse-date
"Parses YYYY-MM-DD date format to time"
[date]
(let [[year month day] (map scan-number (string/split "-" date))]
(os/mktime {:year year :month (dec month) :month-day (dec day)})))
(print (parse-date "2021-01-01")) # 1609459200
(print (os/strftime "%c" (parse-date "2021-01-01"))) # Fri Jan 1 00:00:00 2021