cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using Date

Former Member
0 Kudos

Hi all,

I have a problem while inserting date into the MAX DB Database using EJB Program. I created a table EMPLOYEE and it contains one TIMESTAMP Filed in that. While i am trying to insert the date in the MAX DB to that filed i observed that timestamp is storing 5:30 hours less.

My server time is IST(Indian Standard Time)that is equal to 5:30 GMT. What i observed is in the database the date and timestamp are inserting based on the GMT eventhough the server TimeZone is IST(5:30 GMT).

How can i solve my problem in order to insert the date as IST.

Is there any setting in the server to change the TimeZone. Becoz it is taking the GMT.

Any body pls help me out in this issue.

Thanks in advance,

regards,

JAYA.

Accepted Solutions (0)

Answers (1)

Answers (1)

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Ram,

what's your problem? If the system changes the time, it should also change it back when showing that time and also do this right in all places around the globe.

If you change the base time, you are in trouble once connecting computers that have another timezone...

Regards,

Benny

Former Member
0 Kudos

Hi,

When you create Timestamp object you need to create like this

Timestamp t = new Timestamp(System.currentTimeMillis());

Hope it works

regards,

Sujesh