diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-04-21 19:16:39 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-04-22 18:24:14 +0200 |
commit | a02038eb0058035d66db246aa676c3b41fa5a078 (patch) | |
tree | d9c24f0f2a38fb17e9bf2d2feb45a779b151abdf /module/datetime | |
parent | Add locale parameter to week-day-name. (diff) | |
download | calp-a02038eb0058035d66db246aa676c3b41fa5a078.tar.gz calp-a02038eb0058035d66db246aa676c3b41fa5a078.tar.xz |
Add ~Z format to datetimes.
Diffstat (limited to '')
-rw-r--r-- | module/datetime/util.scm | 3 |
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) |