[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] rfc822
From: |
Daishi Kato |
Subject: |
[Chicken-users] rfc822 |
Date: |
Thu, 3 Aug 2006 15:43:47 +0900 |
Hi,
Although I'm not sure how soon rfc822-date->date in the rfc822 egg is
going to be implemented,
I made a similar procedure, which I found useful.
This would be chicken-specific, but does not requre SRFI-19.
How do you like it?
Daishi
P.S. Can anybody explain why it does "abs" for rem?
(define (rfc822date->seconds string)
(receive (year month day hour min sec tz . rest)
(rfc822-parse-date string)
(and year
(- (utc-time->seconds
(vector sec min hour day (- month 1) (- year 1900) 0 0 #f 0))
(let ([quot (quotient tz 100)]
[rem (remainder tz 100)])
(+ (* quot 3600) (* (abs rem) 60)))))))
- [Chicken-users] rfc822,
Daishi Kato <=