I'm guessing you're using a java.util.Date in your Hibernate object.  I'd
recommend trying a java.sql.Date field.


> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Dale Bronk
> Sent: Monday, January 25, 2010 10:51 AM
> To: [email protected]
> Subject: RE: [AFFUG Discuss] Dates and Timezones
> 
> We are DB agnostic.  Current customers are using MSSQL, but some will no
> doubt be Oracle.  We are using DATE as the datatype in the db.  I don't
know
> about MySql, but MSSQL and Oracle will still store a time value in a DATE
> field, just stores as 00:00:00 if none is given.  I do not believe the
issue
> is the DB, it is the Date Object in Java and/or Flex and the
> (de)serialization of that object to/from each.  They store a blip in time
> which includes time.  If no time is giving, time is defaulted to 00:00:00
> (ie: midnight).
> 
> I've placed breakpoints in my entities readExternal function and look at
> what is coming in on the IDataInput.readObject() call and at that time the
> TZ conversion has already happened.
> 
> Dale
> 
> 
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Lukas Bradley
> Sent: Monday, January 25, 2010 10:13 AM
> To: [email protected]
> Subject: RE: [AFFUG Discuss] Dates and Timezones
> 
> Do you want the database field to contain a time?  What database are you
> using?   MySQL?
> 
> Take a look at the DATE type instead of DATETIME.
> 
> > -----Original Message-----
> > From: [email protected] [mailto:[email protected]] On Behalf Of Dale Bronk
> > Sent: Monday, January 25, 2010 9:54 AM
> > To: [email protected]
> > Subject: [AFFUG Discuss] Dates and Timezones
> >
> > I had posted about this before, but never solved it and it is really
> > starting to burn us.  Any idea's or techniques would be appreciated.  I
> > really don't want to have to go to passing dates as strings and
> converting.
> >
> > We use GraniteDS because of it's better integration with Hibernate than
> > BlazeDS.  The issue is with dates.  I can easily reproduce this with my
> > desktop and laptop.  I simply set my desktop to EST and my laptop to
PST.
> > On my desktop I use our app and create a record with a date.  The date
> goes
> > into the DB as 01/25/2010 00:00:00.  No time is set in this example so
the
> > db defaults to midnight.  Now using my laptop with PST I use our app to
> > retrieve the record.  It displays as 01/24/2010.  In debugging, the
exact
> > date is 01/24/2010 @ 9:00pm which is of course the time difference from
> EST
> > to PST.
> >
> > This is really killing us.  We are good with the TZ adjustment when we
are
> > storing dates with times, say a meeting.  That we want to adjust per TZ.
> > But for dates when we only care about the date/no time how can we stop
> this
> > adjustment from happening?
> >
> > For you Hibernate guys and gals, we set these dates in our entities as
> > TemporalType.DATE instead of TemporalType.DATETIME which tells hibernate
> to
> > only care about the date portion.  Doesn't seem to work.  Somewhere in
the
> > serialization/deserialization the conversion is done.
> >
> > I know if we change our entities to take Strings for dates that would
> work,
> > but what a pain that will be.
> >
> > Thanks,
> > Dale
> >
> >
> >
> >
> > -------------------------------------------------------------
> > To unsubscribe from this list, simply email the list with unsubscribe in
> the
> > subject line
> >
> > For more info, see http://www.affug.com
> > Archive @ http://www.mail-archive.com/discussion%40affug.com/
> > List hosted by http://www.fusionlink.com
> > -------------------------------------------------------------
> >
> 
> 
> 
> 
> -------------------------------------------------------------
> To unsubscribe from this list, simply email the list with unsubscribe in
the
> subject line
> 
> For more info, see http://www.affug.com
> Archive @ http://www.mail-archive.com/discussion%40affug.com/
> List hosted by http://www.fusionlink.com
> -------------------------------------------------------------
> 
> 
> 
> 
> 
> -------------------------------------------------------------
> To unsubscribe from this list, simply email the list with unsubscribe in
the
> subject line
> 
> For more info, see http://www.affug.com
> Archive @ http://www.mail-archive.com/discussion%40affug.com/
> List hosted by http://www.fusionlink.com
> -------------------------------------------------------------
> 




-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------


Reply via email to