Search in sources :

Example 51 with MutableDateTime

use of org.joda.time.MutableDateTime in project joda-time by JodaOrg.

the class TestDateTimeFormatter method testParseInto_monthDay_feb29_newYork_endOfYear.

public void testParseInto_monthDay_feb29_newYork_endOfYear() {
    DateTimeFormatter f = DateTimeFormat.forPattern("M d").withLocale(Locale.UK);
    MutableDateTime result = new MutableDateTime(2004, 12, 31, 23, 59, 59, 999, NEWYORK);
    assertEquals(4, f.parseInto(result, "2 29", 0));
    assertEquals(new MutableDateTime(2004, 2, 29, 23, 59, 59, 999, NEWYORK), result);
}
Also used : MutableDateTime(org.joda.time.MutableDateTime)

Example 52 with MutableDateTime

use of org.joda.time.MutableDateTime in project joda-time by JodaOrg.

the class TestDateTimeFormatter method testParseInto_monthDay_withDefaultYear_feb29_newYork_endOfYear.

public void testParseInto_monthDay_withDefaultYear_feb29_newYork_endOfYear() {
    DateTimeFormatter f = DateTimeFormat.forPattern("M d").withDefaultYear(2012);
    MutableDateTime result = new MutableDateTime(2004, 12, 9, 12, 20, 30, 0, NEWYORK);
    assertEquals(4, f.parseInto(result, "2 29", 0));
    assertEquals(new MutableDateTime(2004, 2, 29, 12, 20, 30, 0, NEWYORK), result);
}
Also used : MutableDateTime(org.joda.time.MutableDateTime)

Example 53 with MutableDateTime

use of org.joda.time.MutableDateTime in project joda-time by JodaOrg.

the class TestDateTimeFormatter method testParseInto_monthDay_feb29.

public void testParseInto_monthDay_feb29() {
    DateTimeFormatter f = DateTimeFormat.forPattern("M d").withLocale(Locale.UK);
    MutableDateTime result = new MutableDateTime(2004, 1, 9, 12, 20, 30, 0, LONDON);
    assertEquals(4, f.parseInto(result, "2 29", 0));
    assertEquals(new MutableDateTime(2004, 2, 29, 12, 20, 30, 0, LONDON), result);
}
Also used : MutableDateTime(org.joda.time.MutableDateTime)

Example 54 with MutableDateTime

use of org.joda.time.MutableDateTime in project joda-time by JodaOrg.

the class TestDateTimeFormatter method testParseInto_monthDay_withDefaultYear_feb29_newYork.

public void testParseInto_monthDay_withDefaultYear_feb29_newYork() {
    DateTimeFormatter f = DateTimeFormat.forPattern("M d").withDefaultYear(2012);
    MutableDateTime result = new MutableDateTime(2004, 1, 9, 12, 20, 30, 0, NEWYORK);
    assertEquals(4, f.parseInto(result, "2 29", 0));
    assertEquals(new MutableDateTime(2004, 2, 29, 12, 20, 30, 0, NEWYORK), result);
}
Also used : MutableDateTime(org.joda.time.MutableDateTime)

Example 55 with MutableDateTime

use of org.joda.time.MutableDateTime in project joda-time by JodaOrg.

the class TestDateTimeFormatter method testParseInto_monthOnly.

public void testParseInto_monthOnly() {
    DateTimeFormatter f = DateTimeFormat.forPattern("M").withLocale(Locale.UK);
    MutableDateTime result = new MutableDateTime(2004, 1, 9, 12, 20, 30, 0, LONDON);
    assertEquals(1, f.parseInto(result, "5", 0));
    assertEquals(new MutableDateTime(2004, 5, 9, 12, 20, 30, 0, LONDON), result);
}
Also used : MutableDateTime(org.joda.time.MutableDateTime)

Aggregations

MutableDateTime (org.joda.time.MutableDateTime)65 DateTime (org.joda.time.DateTime)9 Chronology (org.joda.time.Chronology)4 Instant (org.joda.time.Instant)4 DateTimeFormatter (org.joda.time.format.DateTimeFormatter)4 ISOChronology (org.joda.time.chrono.ISOChronology)3 IntervalWindow (org.apache.beam.sdk.transforms.windowing.IntervalWindow)2 SlidingWindows (org.apache.beam.sdk.transforms.windowing.SlidingWindows)2 ElasticsearchParseException (org.elasticsearch.ElasticsearchParseException)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 DateTimeZone (org.joda.time.DateTimeZone)2 ReadableInstant (org.joda.time.ReadableInstant)2 Test (org.junit.Test)2 Category (org.junit.experimental.categories.Category)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 LifecycleStart (io.druid.java.util.common.lifecycle.LifecycleStart)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 BigDecimal (java.math.BigDecimal)1 Timestamp (java.sql.Timestamp)1