dcsimg
Time Difference...
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ellappan_Sathyababu
Posted On:   Tuesday, April 17, 2001 04:12 AM

I'am trying to insert a timestamp value into the database thro' a entity bean. My Code goes like this: db.createdDate = new Timestamp(new System.currentTimeMillis()); It gets inserted with 5:30(+) difference. when i try to print the timestamp it gives a value something like this: '2001-04-17 16:33:11.639' The bean is deployed in sun solaris m/c ,whose timezone has been set to: TZ=GMT+5 & LC_TIME=en_US. But when i print the same in a ordinary java prog in my local m/c, i get something like this: '2001-04-17 11:03:11.639' The difference is 5:30 Hrs. The local m/c timezone has been set to (GMT+5:30)Chennai,Mumbai,Calcutta,delhi Similar   More>>

I'am trying to insert a timestamp value into the database thro' a entity bean.
My Code goes like this:

db.createdDate = new Timestamp(new System.currentTimeMillis());
It gets inserted with 5:30(+) difference.

when i try to print the timestamp it gives a value something like this:
'2001-04-17 16:33:11.639'

The bean is deployed in sun solaris m/c ,whose timezone has been set to:
TZ=GMT+5 & LC_TIME=en_US.

But when i print the same in a ordinary java prog in my local m/c, i get something like this:
'2001-04-17 11:03:11.639'

The difference is 5:30 Hrs.

The local m/c timezone has been set to (GMT+5:30)Chennai,Mumbai,Calcutta,delhi

Similarly when i try to retrieve the date value from the database thro' the same bean and display it in my client application, the same 5:30(+) hrs difference is there.

how to solve this problem?

Thanks,
SathyaBabu.E

   <<Less

Re: Time Difference...

Posted By:   Michael_Herrmann  
Posted On:   Friday, April 20, 2001 03:28 AM

We also had some problems with the timezone. It looks like jdk1.3 can't get the timezone of the OS, so we give a parameter for the java-VM of our Application-Server: "-Duser.timezone=Europe/Berlin". When you replace Europe/Berlin with your value, maybe this helps?
About | Sitemap | Contact