Search in sources :

Example 66 with DateTimeZone

use of org.joda.time.DateTimeZone in project joda-time-android by dlew.

the class TestDateTimeZone method testGetOffset_RI.

public void testGetOffset_RI() {
    DateTimeZone zone = DateTimeZone.forID("Europe/Paris");
    assertEquals(2L * DateTimeConstants.MILLIS_PER_HOUR, zone.getOffset(new Instant(TEST_TIME_SUMMER)));
    assertEquals(1L * DateTimeConstants.MILLIS_PER_HOUR, zone.getOffset(new Instant(TEST_TIME_WINTER)));
    assertEquals(zone.getOffset(DateTimeUtils.currentTimeMillis()), zone.getOffset(null));
}
Also used : Instant(org.joda.time.Instant) DateTimeZone(org.joda.time.DateTimeZone)

Example 67 with DateTimeZone

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));
}
Also used : DateTimeZone(org.joda.time.DateTimeZone) DateTime(org.joda.time.DateTime) LocalDateTime(org.joda.time.LocalDateTime)

Example 68 with DateTimeZone

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));
}
Also used : DateTimeZone(org.joda.time.DateTimeZone) DateTime(org.joda.time.DateTime) LocalDateTime(org.joda.time.LocalDateTime)

Example 69 with DateTimeZone

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));
}
Also used : DateTimeZone(org.joda.time.DateTimeZone) DateTime(org.joda.time.DateTime) LocalDateTime(org.joda.time.LocalDateTime)

Example 70 with DateTimeZone

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));
}
Also used : DateTimeZone(org.joda.time.DateTimeZone)

Aggregations

DateTimeZone (org.joda.time.DateTimeZone)263 DateTime (org.joda.time.DateTime)123 ArrayList (java.util.ArrayList)36 Test (org.testng.annotations.Test)35 LocalDate (org.joda.time.LocalDate)27 Test (org.junit.Test)21 TimeIntervalRounding (org.elasticsearch.common.rounding.Rounding.TimeIntervalRounding)18 TimeUnitRounding (org.elasticsearch.common.rounding.Rounding.TimeUnitRounding)18 DateTimeFormatter (org.joda.time.format.DateTimeFormatter)17 IOException (java.io.IOException)16 HashMap (java.util.HashMap)15 UUID (java.util.UUID)14 TimeFormat (org.gephi.graph.api.TimeFormat)13 MetricExpression (com.linkedin.thirdeye.client.MetricExpression)12 Date (java.util.Date)12 Chronology (org.joda.time.Chronology)12 LocalDateTime (org.joda.time.LocalDateTime)12 DefaultBlockingState (org.killbill.billing.junction.DefaultBlockingState)11 LocalTime (org.joda.time.LocalTime)10 SubscriptionBaseTransition (org.killbill.billing.subscription.api.user.SubscriptionBaseTransition)10