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.
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
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.