aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-04-21 19:16:39 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-04-22 18:24:14 +0200
commita02038eb0058035d66db246aa676c3b41fa5a078 (patch)
treed9c24f0f2a38fb17e9bf2d2feb45a779b151abdf
parentAdd locale parameter to week-day-name. (diff)
downloadcalp-a02038eb0058035d66db246aa676c3b41fa5a078.tar.gz
calp-a02038eb0058035d66db246aa676c3b41fa5a078.tar.xz
Add ~Z format to datetimes.
-rw-r--r--module/datetime/util.scm3
1 files changed, 3 insertions, 0 deletions
diff --git a/module/datetime/util.scm b/module/datetime/util.scm
index 681dd868..2a85c928 100644
--- a/module/datetime/util.scm
+++ b/module/datetime/util.scm
@@ -85,6 +85,8 @@
(zeller J (1- K) (+ m 12) (day date))
(zeller J K (month date) (day date)))))
+
+
;; Given a date, returns the earliest start of week going backwards from that date.
;; sön 22 mar 2020 20:09:57 CET
;; @example
@@ -178,6 +180,7 @@
((#\a) (display (week-day-name (week-day date) 3)))
((#\b) (display (locale-month-short (month date))))
((#\B) (display (locale-month (month date))))
+ ((#\Z) (when (equal? "UTC" (get-timezone datetime)) (display "Z")))
(else (unless allow-unknown?
(error 'datetime->string "Invalid format token ~a" token))))
#f)