Re: Cayenne and GMT Date and Time

From: Michael Gentry (blacknex..mail.com)
Date: Thu Sep 13 2007 - 08:48:28 EDT

  • Next message: Dan Morgan: "RE: [Likely Spam]Re: jdbc connection information"

    Hi Gary,

    I'll start off with saying I haven't done any real date processing
    with Cayenne (outside of calling setModifiedDate() on some records
    with the current date/time). However, I know from working with EOF
    and some databases that the timezone was NOT stored in the database.
    For example, with Sybase, the date/time was all relative (server
    locale). If Sybase had 13:00 for the time, we'd read that as 13:00
    EST (or EDT, you get the idea) and there'd be no +0500 (or +0600)
    associated with it. The summation of my ramble is it might not be
    Cayenne's fault. :-) You might need cover methods on your date
    methods to do conversions for you. I'm just guessing, though.

    /dev/mrg

    On 9/13/07, Gary Jarrel <garyjarre..mail.com> wrote:
    > Hi All!
    >
    > I'm working on a Cayenne app, and am looking for a way to store all
    > dates in the database in GMT irrespective of which locate the
    > application/server is running in?
    >
    > I noticed that even when I would use the code like:
    >
    > TimeZone tzGmt = getGmtTimeZone();
    > Calendar cal = new GregorianCalendar();
    > cal.get(Calendar.HOUR); //this line might not be important at all
    > cal.setTimeZone(TimeZone.getTimeZone("GMT");
    >
    > Then use the date object of cal.getTime() it still stores the date in
    > the locate which the server running the application is configured for!
    >
    > Has anyone done anything similar?
    >
    > Thank you!
    >
    > Gary
    >



    This archive was generated by hypermail 2.0.0 : Thu Sep 13 2007 - 08:49:02 EDT