Timestamp is the best bridge between java and mysql,I think.
On Sun, Oct 19, 2008 at 4:48 PM, Rama [EMAIL PROTECTED] wrote:
DATE TIME ZONE SENSITIVE
DATETIME NOT SENSITIVE TO TIME ZONE
TIMESTAMP TIMEZONE SENSITIVE
iam getting the above problem as date is timezone sensitive.i resolved
iam sorry iam facing same problem with the datetime iam confused and
working/investigating on it.
Problem is :
Java Program MYSQL
- --
-
Default timezone : GMT
+0530
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: MySQL Date problem
CC: mysql@lists.mysql.com; [EMAIL PROTECTED]; [EMAIL PROTECTED]
iam sorry iam facing same problem with the datetime iam confused and
working/investigating on it.
Problem is :
Java Program MYSQL
2008/10/19 Rama [EMAIL PROTECTED]
hi,
iam using java,hibernate,mysql
i am storing *19-10-2008 (*of type java.sql.Date) (TIMEZONE GMT) to
mysql
DATE field.
when i retrieve the same date from mysql to java it is being displayed as
*18-10-2008 18:30:00 GMT *
i could not able to
i figured out the root cause of the problem.
1) Java TIME ZONE is GMT --- storing DATE (2008-10-19
which is in GMT )
2) storing the above date in GMT to mysql
3) MYSQL TIME ZONE IS GMT+05:30
4) as mysql time zone is GMT+05:30 it is viewing the date as (2008-10-19) @
The above argument applies to only MYSQL DATE field (timezone
sensitive)
where as in the case DATETIME Field it does not do any conversion gets
what we store (timezone insensitive)
in the case of TIMESTAMP Field it gets converted between UTC
and local timezone.
SK wrote:
2008/10/19 Rama [EMAIL PROTECTED]
hi,
iam using java,hibernate,mysql
i am storing *19-10-2008 (*of type java.sql.Date) (TIMEZONE GMT) to
mysql
DATE field.
when i retrieve the same date from mysql to java it is being displayed as
*18-10-2008 18:30:00 GMT *
i could not
DATE TIME ZONE SENSITIVE
DATETIME NOT SENSITIVE TO TIME ZONE
TIMESTAMP TIMEZONE SENSITIVE
iam getting the above problem as date is timezone sensitive.i resolved it
by changing the field type from date to string.
YOu can use any method to fill the DATE field of mysql .which method we
use
hi,
iam using java,hibernate,mysql
i am storing *19-10-2008 (*of type java.sql.Date) (TIMEZONE GMT) to mysql
DATE field.
when i retrieve the same date from mysql to java it is being displayed as
*18-10-2008 18:30:00 GMT *
i could not able to figure out what is going wrong . can any one