Skip to content

Instantly share code, notes, and snippets.

@valvallow
Created February 10, 2010 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valvallow/300238 to your computer and use it in GitHub Desktop.
Save valvallow/300238 to your computer and use it in GitHub Desktop.
(define date->gmt
(lambda (date)
(let ((g (lambda (ls dl)
(string-join
(map (lambda (f)
(format #f "~2,,,'0,@a" (f date))) ls) dl))))
(let ((yyyyMMdd (g (list date-year date-month date-day) "-"))
(hhmmdd (format #f "T~aZ"
(g (list date-hour date-minute date-second) ":"))))
(string-append yyyyMMdd hhmmdd)))))
(date->gmt (current-date))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment