use of org.joda.time.DateTimeZone in project joda-time-android by dlew.
the class TestDateTimeZone method testPatchedNameKeysLondon.
public void testPatchedNameKeysLondon() throws Exception {
// the tz database does not have unique name keys [1716305]
DateTimeZone zone = DateTimeZone.forID("Europe/London");
DateTime now = new DateTime(2007, 1, 1, 0, 0, 0, 0);
String str1 = zone.getName(now.getMillis());
String str2 = zone.getName(now.plusMonths(6).getMillis());
assertEquals(false, str1.equals(str2));
}
use of org.joda.time.DateTimeZone in project joda-time-android by dlew.
the class TestDateTimeZone method testPatchedNameKeysSydneyHistoric.
public void testPatchedNameKeysSydneyHistoric() throws Exception {
// the tz database does not have unique name keys [1716305]
DateTimeZone zone = DateTimeZone.forID("Australia/Sydney");
DateTime now = new DateTime(1996, 1, 1, 0, 0, 0, 0);
String str1 = zone.getName(now.getMillis());
String str2 = zone.getName(now.plusMonths(6).getMillis());
assertEquals(false, str1.equals(str2));
}
use of org.joda.time.DateTimeZone in project joda-time-android by dlew.
the class TestDateTimeZone method testPatchedNameKeysSydney.
public void testPatchedNameKeysSydney() throws Exception {
// the tz database does not have unique name keys [1716305]
DateTimeZone zone = DateTimeZone.forID("Australia/Sydney");
DateTime now = new DateTime(2007, 1, 1, 0, 0, 0, 0);
String str1 = zone.getName(now.getMillis());
String str2 = zone.getName(now.plusMonths(6).getMillis());
assertEquals(false, str1.equals(str2));
}
use of org.joda.time.DateTimeZone in project joda-time-android by dlew.
the class TestDateTimeZone method testGetShortNameNullKey.
public void testGetShortNameNullKey() {
DateTimeZone zone = new MockDateTimeZone("Europe/London");
assertEquals("Europe/London", zone.getShortName(TEST_TIME_SUMMER, Locale.ENGLISH));
}
use of org.joda.time.DateTimeZone in project joda-time-android by dlew.
the class TestDateTimeZone method testIsLocalDateTimeGap_NewYork.
//-----------------------------------------------------------------------
public void testIsLocalDateTimeGap_NewYork() {
DateTimeZone zone = DateTimeZone.forID("America/New_York");
assertEquals(false, zone.isLocalDateTimeGap(new LocalDateTime(2007, 3, 11, 1, 0)));
assertEquals(false, zone.isLocalDateTimeGap(new LocalDateTime(2007, 3, 11, 1, 59, 59, 99)));
assertEquals(true, zone.isLocalDateTimeGap(new LocalDateTime(2007, 3, 11, 2, 0)));
assertEquals(true, zone.isLocalDateTimeGap(new LocalDateTime(2007, 3, 11, 2, 30)));
assertEquals(true, zone.isLocalDateTimeGap(new LocalDateTime(2007, 3, 11, 2, 59, 59, 99)));
assertEquals(false, zone.isLocalDateTimeGap(new LocalDateTime(2007, 3, 11, 3, 0)));
assertEquals(false, zone.isLocalDateTimeGap(new LocalDateTime(2007, 3, 11, 4, 0)));
// before overlap
assertEquals(false, zone.isLocalDateTimeGap(new LocalDateTime(2007, 11, 4, 0, 30)));
// overlap
assertEquals(false, zone.isLocalDateTimeGap(new LocalDateTime(2007, 11, 4, 1, 30)));
// after overlap
assertEquals(false, zone.isLocalDateTimeGap(new LocalDateTime(2007, 11, 4, 2, 30)));
assertEquals(false, zone.isLocalDateTimeGap(new LocalDateTime(2007, 12, 24, 12, 34)));
}
Aggregations