Re: [racket] Converting a date to seconds

2011-08-03 Thread Mark Carter
- Original Message - > From: Tony Garnock-Jones > #lang racket > (require srfi/19) > (define (date->seconds date epoch-date) >   (time-second >     (time-difference (date->time-utc date) >                     (date->time-utc epoch-date > (date->seconds (current-date) >            

Re: [racket] Converting a date to seconds

2011-08-01 Thread Tony Garnock-Jones
On 2011-07-31 6:47 AM, Mark Carter wrote: > The alternative would be to use srfi/19, which has a usable make-date > function, but doesn't seem to be able to convert that to seconds. This will work, but it suffers from the problems of Unix's time_t (which I hope aren't a problem for you, since you'

Re: [racket] Converting a date to seconds

2011-07-31 Thread Matthew Flatt
I think you want `find-seconds', which doesn't need a week day or year day. At Sun, 31 Jul 2011 11:47:13 +0100 (BST), Mark Carter wrote: > I'm trying to do a calculation which requires converting a date into years. > > Converting a date into seconds is OK, too. > > The problem is, there doesn't

[racket] Converting a date to seconds

2011-07-31 Thread Mark Carter
I'm trying to do a calculation which requires converting a date into years. Converting a date into seconds is OK, too. The problem is, there doesn't seem to be a good way of doing this in Racket. There is a date->seconds function, which looks useful. However, the make-date function takes in a