[racket-dev] (current-date)

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Feb 1 18:22:59 EST 2013

At Wed, 30 Jan 2013 22:23:04 -0500, Asumu Takikawa wrote:
> On 2013-01-30 23:20:45 +0100, Pierpaolo Bernardi wrote:
> >    Any reason not to define current-date in this way? there's a nanosecond
> >    field there wanting to get into action.
> 
> While we're on the subject, it's also weird that `date->seconds` has a
> contract accepting date? and so doesn't handle date*'s extra nanosecond
> field (note that `seconds->date` produces date*s):
> 
>   Welcome to Racket v5.3.2.3.
>   -> (require racket/date)
>   -> (define s (* #i1/1000 (current-inexact-milliseconds)))
>   -> s
>   1359602380.5059009
>   -> (date->seconds (seconds->date s))
>   1359602380

I've changed `current-date'.

Some existing code may rely on `date->seconds' returning an exact
integer, so I've added `date*->seconds'.


Posted on the dev mailing list.