Re: BUG for date

"Gorazd Praprotnik" <[email protected]>
Newsgroups gmane.comp.db.mckoi
Message-ID <004101c51060$a540f650$8d02a8c0@riana141xp>
Hi, Toby.

Yes, you are right about date, which it could be different in different
timezones, but this rule stands only for current date. Let see some example.
If I want to calculate some interests from one day A (saved in DB) till some
day B, in different timezones, you could get different result (you have
different function for interpreting date - date A from DB (getDate()) is one
day wrong, date B is right, because you just write it). But interests must
be the same anywhere in any timezone, even in Universe (OK, maybe not in
black hole). And If somebody sue you, you can't tell judge, hey don't blame
me, I just derived getDate() from java.sql.Date. I hope I didn't ofend you,
I just want that you understand how important is this issue. I admire your
job, you did it well.

Have a nice day!

Gorazd

----- Original Message -----
From: "Tobias Downer" <[email protected]>
To: <[email protected]>
Sent: Thursday, February 10, 2005 6:13 PM
Subject: Re: BUG for date


> Unfortunately java.sql.Date is derived from java.util.Date and therefore
> inherits the timezone properties as well.  Since java.util.Date is
> primitively based on a universal time system (number of milliseconds
> since Jan 1st, 1970) using getDate on a client where the timezone is not
> the same as the server can be problematic.  Mckoi also primitively uses
> the same system to store dates and currently simply passes that value
> from server to client.  Technically the JDBC driver should convert the
> date to the local timezone and we plan to change the current behaviour.
>
> One way to manage dates in a universal time zone format is to cast the
> date to a string in the SQL query.  For example;
>
>    SELECT CAST(my_date AS TEXT) FROM my_table
>
> With the above query, since the string format will be generated on the
> server there will be no conversion problems if the time zone on the
> client is different.
>
> Toby.
>
>
> Pascal Paradis-Théberge wrote:
>
> > I thought java.sql.Date had no time component (the time fields are all
> > set to 0) so from this it follows that it doesn't matter which timezone
> > the client machine is in, a date should be the same.
> >
> > Or am I missing something?
> >
> > Pascal
> >
> > Patrick wrote:
> >
> >>Well no.  The date is NOT the date across timezones.  In the US for
> >>instance the date changes one hour earlier in the east than it does in
> >>the US Central timezone.
> >>
> >>-----Original Message-----
> >>From: [email protected] [mailto:[email protected]] On Behalf Of Gorazd
> >>Praprotnik
> >>Sent: Thursday, February 10, 2005 2:34 PM
> >>To: [email protected]
> >>Subject: Re: BUG for date
> >>
> >>Hi, Rick.
> >>
> >>Yes, you are right. If I change timezone, values are right. Thank you
> >>for
> >>replay. But for me is still bug,
> >>because date is date, and it must be same in every time zone. I'd tested
> >>with other drivers and things worked fine.
> >>I think you shoud repair this bug, even it is more academic issue. Thank
> >>you
> >>again.
> >>
> >>Have a nice day.
> >>
> >>Gorazd
>
>
>
> ---------------------------------------------------------------
> Mckoi SQL Database mailing list  http://www.mckoi.com/database/
> To unsubscribe, send a message to [email protected]
>
>



---------------------------------------------------------------
Mckoi SQL Database mailing list  http://www.mckoi.com/database/
To unsubscribe, send a message to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.