summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-04-11 22:25:40 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-04-11 22:33:54 -0400
commit35bb74497dc7854feffa1e5d373e1f713da6a565 (patch)
tree8d322e49a516ef19fb0732e2c503fb7c0008bdf3
parent2e136d15a5b93710377bcba3d9181b949bb55c0b (diff)
utils: Add string->date*.
* haunt/utils.scm (string->date*): New procedure.
-rw-r--r--haunt/utils.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/haunt/utils.scm b/haunt/utils.scm
index b49af4e..b9fe5e6 100644
--- a/haunt/utils.scm
+++ b/haunt/utils.scm
@@ -27,13 +27,15 @@
#:use-module (ice-9 ftw)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-19)
#:use-module (srfi srfi-26)
#:export (flatten
flat-map
string-split-at
absolute-file-name
clean-directory
- mkdir-p))
+ mkdir-p
+ string->date*
(define* (flatten lst #:optional depth)
"Return a list that recursively concatenates the sub-lists of LST,
@@ -98,3 +100,8 @@ flattened."
(loop tail path)
(apply throw args))))))
(() #t))))
+
+(define (string->date* str)
+ "Convert STR, a string in '~Y~m~d ~H:~M' format, into a SRFI-19 date
+object."
+ (string->date str "~Y~m~d ~H:~M"))