use of java.util.TimeZone in project j2objc by google.
the class SimpleTimeZoneTest method testDstParis2014_30thMarch_26thOctober_UtcTime.
public void testDstParis2014_30thMarch_26thOctober_UtcTime() {
TimeZone timeZone = new SimpleTimeZone(PARIS_RAW_OFFSET, "Europe/Paris", Calendar.MARCH, 30, 0, 3600000, SimpleTimeZone.UTC_TIME, Calendar.OCTOBER, 26, 0, 3600000, SimpleTimeZone.UTC_TIME, 3600000);
checkDstParis2014(timeZone);
}
use of java.util.TimeZone in project j2objc by google.
the class SimpleTimeZoneTest method testDstNewYork2014_2ndSundayMarch_1stSundayNovember_StandardTime.
public void testDstNewYork2014_2ndSundayMarch_1stSundayNovember_StandardTime() {
TimeZone timeZone = new SimpleTimeZone(NEW_YORK_RAW_OFFSET, "EST", Calendar.MARCH, 2, Calendar.SUNDAY, 7200000, SimpleTimeZone.STANDARD_TIME, Calendar.NOVEMBER, 1, Calendar.SUNDAY, 3600000, SimpleTimeZone.STANDARD_TIME, 3600000);
checkDstNewYork2014(timeZone);
}
use of java.util.TimeZone in project j2objc by google.
the class TimeZoneTest method testOverflowing32BitUnixDates.
// http://b/18839557
public void testOverflowing32BitUnixDates() {
final TimeZone tz = TimeZone.getTimeZone("America/New_York");
// This timezone didn't have any daylight savings prior to 1917 and this
// date is sometime in 1901.
assertFalse(tz.inDaylightTime(new Date(-2206292400000L)));
assertEquals(-18000000, tz.getOffset(-2206292400000L));
// Nov 30th 2039, no daylight savings as per current rules.
assertFalse(tz.inDaylightTime(new Date(2206292400000L)));
assertEquals(-18000000, tz.getOffset(2206292400000L));
}
use of java.util.TimeZone in project j2objc by google.
the class TimeZoneTest method test_useDaylightTime_Taiwan.
// http://code.google.com/p/android/issues/detail?id=877
public void test_useDaylightTime_Taiwan() {
TimeZone asiaTaipei = TimeZone.getTimeZone("Asia/Taipei");
assertFalse("Taiwan doesn't use DST", asiaTaipei.useDaylightTime());
}
use of java.util.TimeZone in project j2objc by google.
the class TimeZoneTest method testTimeZoneIDLocalization.
public void testTimeZoneIDLocalization() {
Locale defaultLocale = Locale.getDefault();
try {
Locale.setDefault(new Locale("en"));
TimeZone en_timezone = TimeZone.getTimeZone("GMT+09:00");
Locale.setDefault(new Locale("ar"));
TimeZone ar_timezone = TimeZone.getTimeZone("GMT+09:00");
assertEquals(en_timezone.getID(), ar_timezone.getID());
} finally {
Locale.setDefault(defaultLocale);
}
}
Aggregations