| Author |
how to get the date in required timezone?
|
Suresh K Babu
Greenhorn
Joined: Feb 10, 2007
Posts: 16
|
|
Hi All,
Can anybody please let me know how to get the date in required timezone?
I tried with below java program, but it is returning date properly except timezone for the date as given in output.
How to I get proper timezone as well?
Appreciated your help.
Program output:
Current Time=Wed Jun 09 23:28:55 IST 2010
Current Timezone=India Standard Time
Getting Time in the timezone=Canada/Central
Current Time there=Wed Jun 09 12:58:55 IST 2010
Thanks,
Suresh
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4163
|
|
Suresh K Babu wrote: it is returning date properly except timezone for the date as given in output.
Oh, but it is. When it's Wed Jun 09 23:28:55 2010 in Canada/Central it's Wed Jun 09 12:58:55 2010 in India.
Now if you want the String representation of that date in Canada/Central time, use an appropriate SimpleDateFormat.
|
luck, db
There are no new questions, but there may be new answers.
|
 |
John de Michele
Rancher
Joined: Mar 09, 2009
Posts: 600
|
|
Shouldn't that be Thursday, June 10th? Indian Standard Time is ahead of CDT.
John.
|
 |
 |
|
|
subject: how to get the date in required timezone?
|
|
|