Compare commits

...

2 commits

Author SHA1 Message Date
9c2e5ca79c
Add time library 2025-05-01 10:21:05 +09:00
05118ba453
Update env 2025-05-01 10:20:16 +09:00
2 changed files with 30 additions and 0 deletions

View file

@ -1,2 +1,6 @@
HP_ENV=
HP_URL=
MICROCMS_SERVICE_DOMAIN=
MICROCMS_API_KEY=
CLOUDFLARE_ZONE_ID=
CLOUDFLARE_API_KEY=

26
src/lib/time.lisp Normal file
View file

@ -0,0 +1,26 @@
(defpackage #:hp/lib/time
(:use #:cl)
(:import-from #:local-time
#:reread-timezone-repository
#:find-timezone-by-location-name
#:parse-timestring
#:format-timestring)
(:export #:datetime
#:jp-datetime))
(in-package #:hp/lib/time)
(reread-timezone-repository)
(setf local-time:*default-timezone*
(find-timezone-by-location-name "Asia/Tokyo"))
(defun datetime (timestring)
(format-timestring nil
(parse-timestring timestring)
:format '(:year "-" (:month 2) "-" (:day 2) " "
(:hour 2) ":" (:min 2))))
(defun jp-datetime (timestring)
(format-timestring nil
(parse-timestring timestring)
:format '(:year "年" :month "月" :day "日" " "
:hour "時" :min "分")))