java.sql.dat

I

Ike

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
 
T

Tris Orendorff

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------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top