rfc3339-old: RFC 3339 Timestamps
(require rfc3339-old) | package: rfc3339-old |
1 Introduction
2 Record Type
procedure
(rfc3339-record:year rec) β (or/c #f nonnegative-integer?)
rec : rfc3339-record? (rfc3339-record:month rec) β (or/c #f nonnegative-integer?) rec : rfc3339-record? (rfc3339-record:mday rec) β (or/c #f nonnegative-integer?) rec : rfc3339-record? (rfc3339-record:hour rec) β (or/c #f nonnegative-integer?) rec : rfc3339-record? (rfc3339-record:minute rec) β (or/c #f nonnegative-integer?) rec : rfc3339-record? (rfc3339-record:second rec) β (or/c #f nonnegative-integer?) rec : rfc3339-record? (rfc3339-record:secfrac rec) β (or/c #f nonnegative-integer?) rec : rfc3339-record? (rfc3339-record:offsetmin rec) β (or/c #f nonnegative-integer?) rec : rfc3339-record?
procedure
rec : rfc3339-record? val : (or/c #f nonnegative-integer?) (rfc3339-record:set-month! rec val) β void? rec : rfc3339-record? val : (or/c #f nonnegative-integer?) (rfc3339-record:set-mday! rec val) β void? rec : rfc3339-record? val : (or/c #f nonnegative-integer?) (rfc3339-record:set-hour! rec val) β void? rec : rfc3339-record? val : (or/c #f nonnegative-integer?) (rfc3339-record:set-minute! rec val) β void? rec : rfc3339-record? val : (or/c #f nonnegative-integer?) (rfc3339-record:set-second! rec val) β void? rec : rfc3339-record? val : (or/c #f nonnegative-integer?) (rfc3339-record:set-secfrac! rec frac) β void? rec : rfc3339-record? frac : (or/c #f real?) (rfc3339-record:set-offsetmin! rec val) β void? rec : rfc3339-record? val : (or/c #f nonnegative-integer?)
procedure
β
(list/c (or/c #f nonnegative-integer?) (or/c #f nonnegative-integer?) (or/c #f nonnegative-integer?) (or/c #f nonnegative-integer?) (or/c #f nonnegative-integer?) (or/c #f nonnegative-integer?) (or/c #f real?) (or/c #f nonnegative-integer?)) rec : rfc3339-record?
> (rfc3339-record->list (make-rfc3339-record 1985 4 12 23 20 50 0.52 0)) (1985 4 12 23 20 50 0.52 0)
3 Parsing
> (rfc3339-string->list "1985-04-12T23:20:69.52+5:0") (1985 4 12 23 20 69 0.52 300)
> (rfc3339-string->vector "1985-04-12T23:20:69.52+5:0") #(1985 4 12 23 20 69 0.52 300)
4 Formatting
5 Validation
procedure
(check-rfc3339-record-date rec explain?) β (or/c #f list?)
rec : rfc3339-record? explain? : boolean? (check-rfc3339-record-time rec explain?) β (or/c #f list?) rec : rfc3339-record? explain? : boolean? (check-rfc3339-record-offset rec explain?) β (or/c #f list?) rec : rfc3339-record? explain? : boolean?
> (check-rfc3339-record-date (string->rfc3339-record "1999-02") #t) (missing mday)
> (check-rfc3339-record-date (string->rfc3339-record "1999-02-29") #t) (invalid mday 29 (and (integer? mday) (<= 1 mday (month-days year month))))
> (check-rfc3339-record-date (string->rfc3339-record "2000-02-29") #t) #f
procedure
(check-rfc3339-record-full rec explain?) β (or/c #f list?)
rec : rfc3339-record? explain? : boolean?
6 SRFI-19 Interoperability
procedure
(rfc3339-string->srfi19-date/constructor str make-date) β any str : string make-date : procedure?
(define (rfc3339-string->date str) (rfc3339-string->srfi19-date/constructor str make-date))
7 History
- Version 2:0 β
2016-02-29 Moving from PLaneT to new package system.
Removed dependency on SRFI-9, while keeping same interface.
- Version 1:1 β
2009-03-03 License is now LGPL 3.
Converted to authorβs new Scheme administration system.
Changes for PLT 4.x.
- Version 1:0 β
2005-12-05 Release for PLT 299/3xx.
Changed portability note in light of Pregexp post-1e9 bug fix.
Minor documentation changes.
- Version 0.1 β
2005-01-30 Initial release.
8 Legal
Copyright 2005, 2009, 2016 Neil Van Dyke. This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See http://www.gnu.org/licenses/ for details. For other licenses and consulting, please contact the author.