Can I get the perfect date and time at a perticular location with the help of TimeZone?
The code I am using is:
The output is:
Eastern Standard Time
-18000000
EST
Date:Sun Dec 26 13:34:51 IST 2010
Press any key to continue . . .
I am trying to get the date and time at the specified TimeZone (Eastern Standard Time) but I am getting the system date and time.
Am I making any mistake in the code? Please guide me.
The Three-letter time zone IDs are deprecated, therefore you are better of by using the long zone id - eg. "America/Los_Angeles".
The TimeZone isn't been shown on a Date object, because it has no information on it - but it is stored on the Calendar object, therefore you need to use this information when you want to show the correct Date/Time by using SimpleDateFormat.
Regards, Rene Larsen
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
Gift giving made easy with the permaculture playing cards