[racket] min and max representable dates

From: Jordan Johnson (jmj at fellowhuman.com)
Date: Sun Mar 1 19:07:57 EST 2015

Hi all,

Am I right in thinking the min and max dates that racket/date can handle are platform-dependent? If so, is there any constant I can reasonably use as a least or greatest representable date?

I’ve looked in racket/date.rkt and see that there’s some code that appears to be doing binsearch on greatest/least values that seconds->date will accept without error, and eventually I gave up chasing seconds->date down the rabbit hole of racket/base. I really don’t want to get into putting the same binsearch code into my library, but need plausible-yet-safe min/max values.

Context: I’m working on RFC6265 cookie support, and there are some places where the RFC calls for these min/max values explicitly. I expect a pretty conservative estimate is A-OK if it’d be sure of not throwing an error on 32+-bit systems; I see 2^32 seconds would get us at least to the year 2106...


Posted on the users mailing list.