On 8/22/2015 5:50 PM, Jon Zeppieri wrote:
On Sat, Aug 22, 2015 at 4:36 PM, George Neuner <gneun...@comcast.net> wrote:
>
> The latter code using date works properly (modulo the time zone field) and
> gives consistent results, but the former using date* gives inconsistent
> results.
>
>  E.g.,: with timezone = -5
>
> => expires #(struct:sql-timestamp 2015 8 22 21 56 33 805346000 0)
> => expires #(struct:date* 33 56 21 22 8 2015 6 233 #f 0 805346000 "")
> => expires #(struct:date* 58 9 17 22 8 2015 6 233 #f 0 346000000 "UTC")
>
> => expires #(struct:sql-timestamp 2015 8 22 22 23 45 95751000 0)
> => expires #(struct:date* 45 23 22 22 8 2015 6 233 #f 0 95751000 "")
> => expires #(struct:date* 20 25 17 22 8 2015 6 233 #f 0 751000000 "UTC")
>

These both look wrong to me. Maybe I'm confused, but my understanding
is that the database timestamp is in UTC, and you want a date*
representing the same point in time, but in specified UTC offset.

Yes.  I need to render the dates/times into a client provided time zone.

   :

So, yeah, I'd say that there's a bug in date*->seconds:

   :

Thanks for confirming that - it was driving me crazy.

I have changed to using *date->seconds* everywhere and it seems to be working correctly. Now I just have to figure out how to get the right value in the time zone field. I guess there's no way to do that without constructing a new date structure?

George

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to