Hi,
Could someon please let me know how i can find out the java timezoneid for Amarillo?
I've written this piece of code to get all the timezone id but it doesnt return anything for Amarillo (US)
import java.util.TimeZone;
import java.util.Date;
public class TimeZones {
public static void main(String[] a) {
Date today = new Date();
// Get all time zone ids
String[] zoneIds = TimeZone.getAvailableIDs();
// View every time zone
for (int i=0; i<zoneIds.length; i++) {
// Get time zone by time zone id
TimeZone tz = TimeZone.getTimeZone(zoneIds);
System.out.println("==========================================================");
System.out.println("TimezoneID = " + tz.getID());
System.out.println("DisplayName = " + tz.getDisplayName());
System.out.println("DisplayName SHORT = " + tz.getDisplayName(tz.inDaylightTime(today), TimeZone.SHORT));
System.out.println("DisplayName LONG = " + tz.getDisplayName(tz.inDaylightTime(today), TimeZone.LONG));
System.out.println("Timezone = " + tz.getTimeZone(zoneIds[i]));
System.out.println("Has Daylight saving time period = " + tz.useDaylightTime());
System.out.println("In Daylight savings time = " + tz.inDaylightTime(today));
}
}
}
And also, if i use a timezone, for example Europe/London, would i have to update my program every time the clock changes in the UK (e.g. to British summer time)?
Thanks
ps. Question also posted in another forum.