From 3527bb143b6a6740a9f51b0eaf87c883060c86bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 25 Jun 2020 18:07:42 +0200 Subject: Merge UTC-OFFSET and TIMESPEC into one. --- module/datetime/timespec.scm | 92 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 module/datetime/timespec.scm (limited to 'module/datetime/timespec.scm') diff --git a/module/datetime/timespec.scm b/module/datetime/timespec.scm new file mode 100644 index 00000000..ae8b3d9b --- /dev/null +++ b/module/datetime/timespec.scm @@ -0,0 +1,92 @@ +;;; Commentary: +;; Datatype for holding timechanges and time offesets. +;; Used both for timespecs from the TZ-database, and for UTC-OFFSET from RFC5545. +;;; Code: + +(define-module (datetime timespec) + :use-module (util) + :use-module (util exceptions) + :use-module (datetime) + :use-module (datetime util) + :use-module (srfi srfi-1) + :use-module (srfi srfi-9 gnu) + ) + + +;; timespec as defined by the TZ-database +;; also used UTC-OFFSET defined by RFC5545. Then type should equal #\z +;; and be ignored. +(define-immutable-record-type ; EXPORTED + (make-timespec timespec-time sign type) + timespec? + (timespec-time timespec-time) ;