Hi I am looking to set the timezone for San Antonio, Texas.Can some please tell me how do i set the same in my Java code.
I want it in the format somewhat similar to America/New York
Currently I am using this code
TimeZone.getTimeZone("America/Denver");
But "America/Denver" doesn't seem to be the right timezone for San Antonio, Texas
For San Antonio, you should use TimeZone.getTimeZone("US/Central")
If you really need to use "America/<City>"
format, the closest to San Antonio us city is "America/Chicago"
.
You can use this to get a list of all available specific IDs for US/Central:
String[] values = TimeZone.getAvailableIDs(TimeZone.getTimeZone("US/Central").getRawOffset());
And then, double check here:
http://www.timeanddate.com/time/zones/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With