Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

getTimeInMillis() returning the same value for different Time Zones

832069Jan 18 2011 — edited Jan 19 2011
Hi,

The getTimeInMillis() is always returning me the same value for different time zones.
I am required to pass the getTimeInMillis() value or another time zone in the program.
The source code below.


Calendar cal1 = Calendar.getInstance(TimeZone.getTimeZone("EST"));
System.out.println(cal1.getTimeInMillis());

Calendar cal2 = Calendar.getInstance(TimeZone.getTimeZone("IST"));
System.out.println(cal2.getTimeInMillis());


Any help regarding this is appreciated.

Thank you
Achyuth
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 16 2011
Added on Jan 18 2011
28 comments
3,489 views