List:General Discussion« Previous MessageNext Message »
From:Rama Date:October 19 2008 8:48am
Subject:Re: MySQL Date problem
View as plain text  
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 to fill mysql date" is not important in this context.


On Sun, Oct 19, 2008 at 1:33 PM, Roland Kaber <roland.kaber@stripped> wrote:

> SK wrote:
>
>> 2008/10/19 Rama <ramaakrishnaa@stripped>
>>
>>
>>
>>> 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 please
>>> guide me   on What can go wrong in above scenario?
>>>
>>>
>>>
>> there are a lot of mothods to express data in java,but in mysql only have
>> one type.
>> may be types not match.
>>
>> i think you should  storing "19-10-2008" to mysql char(10) field.
>>
>>
>>
>>
>>> --rama
>>>
>>>
>>>
>>
>>
>>
>
> Hi
>
> What about using the STR_TO_DATE function to transform the java Date as a
> MySQL Date: STR_TO_DATE('19/10/2008', '%m/%d/%Y')? To transform this back
> into the original format, you may use the DATE_FORMAT function:
> DATE_FORMAT('2008-10-19', '%d/%m/%Y).
>
> Best regards
> Roland
>

Thread
MySQL Date problemRama19 Oct
  • Re: MySQL Date problemSK19 Oct
    • Re: MySQL Date problemRama19 Oct
      • Re: MySQL Date problemRama19 Oct
    • Re: MySQL Date problemRoland Kaber19 Oct
      • Re: MySQL Date problemRama19 Oct
        • Re: MySQL Date problemMoon's Father21 Oct
          • Re: MySQL Date problemRama21 Oct
Re: MySQL Date problemRama21 Oct