From 9a6586a0a33e97cdee8cb417556f033b9c6b93a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 2 Mar 2019 23:13:41 +0100 Subject: Move datetime stuff to better suited files. --- vcalendar/datetime.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 vcalendar/datetime.scm (limited to 'vcalendar') diff --git a/vcalendar/datetime.scm b/vcalendar/datetime.scm new file mode 100644 index 00000000..af8382c8 --- /dev/null +++ b/vcalendar/datetime.scm @@ -0,0 +1,16 @@ +(define-module (vcalendar datetime) + #:use-module (srfi srfi-19) + #:use-module (srfi srfi-19 util) + + #:export (parse-datetime) + ) + +(define (parse-datetime dtime) + "Parse the given date[time] string into a date object." + (localize-date + (string->date + dtime + (case (string-length dtime) + ((8) "~Y~m~d") + ((15) "~Y~m~dT~H~M~S") + ((16) "~Y~m~dT~H~M~S~z"))))) -- cgit v1.2.3