Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java.sql.dat

Reply
Thread Tools

java.sql.dat

 
 
Ike
Guest
Posts: n/a
 
      10-23-2003
For some reason (perhaps because I am running this on Windows?) when I
convert a string in yyyy-mm-dd format to a java.sql.Date, if it is before
April 6, 2003, the value is saved as one day less than is designated in the
String!

For example:

java.sql.Date.valueOf("2003-04-06")

gets stored as a java.sql.Date object as "2003-04-05."

Does anyone have any idea why this is happening, or any experience with such
things happening to them? Thanks, Ike


 
Reply With Quote
 
 
 
 
Tris Orendorff
Guest
Posts: n/a
 
      10-24-2003
"Ike" <(E-Mail Removed)> wrote in
news:6rPlb.15482$(E-Mail Removed) link.net:

> For some reason (perhaps because I am running this on Windows?) when I
> convert a string in yyyy-mm-dd format to a java.sql.Date, if it is
> before April 6, 2003, the value is saved as one day less than is
> designated in the String!
>
> For example:
>
> java.sql.Date.valueOf("2003-04-06")
>
> gets stored as a java.sql.Date object as "2003-04-05."
>
> Does anyone have any idea why this is happening, or any experience
> with such things happening to them? Thanks, Ike



Daylight Savings Time is doing this. 2003-04-06 at 0:00 is changing to
2003-04-05 at 23:00.


--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d++ s+:- a+ C+ UL++++ P+ L+ E- W+ N++ o- K++ w+ O+ M !V PS+ PE Y+ PGP
t+ !5 X- R- tv--- b++ DI++ D+ G++ e++ h---- r+++ y+++
------END GEEK CODE BLOCK------

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments