Java 类org.joda.time.tz.DateTimeZoneBuilder 实例源码

项目:astor    文件:TestDateTimeZoneCutover.java   
public void test_DateTime_JustAfterLastEverOverlap() {
    // based on America/Argentina/Catamarca in file 2009s
    DateTimeZone zone = new DateTimeZoneBuilder()
        .setStandardOffset(-3 * DateTimeConstants.MILLIS_PER_HOUR)
        .addRecurringSavings("SUMMER", 1 * DateTimeConstants.MILLIS_PER_HOUR, 2000, 2008,
                                'w', 4, 10, 0, true, 23 * DateTimeConstants.MILLIS_PER_HOUR)
        .addRecurringSavings("WINTER", 0, 2000, 2008,
                                'w', 8, 10, 0, true, 0 * DateTimeConstants.MILLIS_PER_HOUR)
        .toDateTimeZone("Zone", false);

    LocalDate date = new LocalDate(2008, 8, 10);
    assertEquals("2008-08-10", date.toString());

    DateTime dt = date.toDateTimeAtStartOfDay(zone);
    assertEquals("2008-08-10T00:00:00.000-03:00", dt.toString());
}
项目:astor    文件:TestDateTimeZoneCutover.java   
public void test_DateTime_JustAfterLastEverOverlap() {
    // based on America/Argentina/Catamarca in file 2009s
    DateTimeZone zone = new DateTimeZoneBuilder()
        .setStandardOffset(-3 * DateTimeConstants.MILLIS_PER_HOUR)
        .addRecurringSavings("SUMMER", 1 * DateTimeConstants.MILLIS_PER_HOUR, 2000, 2008,
                                'w', 4, 10, 0, true, 23 * DateTimeConstants.MILLIS_PER_HOUR)
        .addRecurringSavings("WINTER", 0, 2000, 2008,
                                'w', 8, 10, 0, true, 0 * DateTimeConstants.MILLIS_PER_HOUR)
        .toDateTimeZone("Zone", false);

    LocalDate date = new LocalDate(2008, 8, 10);
    assertEquals("2008-08-10", date.toString());

    DateTime dt = date.toDateTimeAtStartOfDay(zone);
    assertEquals("2008-08-10T00:00:00.000-03:00", dt.toString());
}
项目:versemem-android    文件:TestDateTimeZoneCutover.java   
public void test_DateTime_JustAfterLastEverOverlap() {
    // based on America/Argentina/Catamarca in file 2009s
    DateTimeZone zone = new DateTimeZoneBuilder()
        .setStandardOffset(-3 * DateTimeConstants.MILLIS_PER_HOUR)
        .addRecurringSavings("SUMMER", 1 * DateTimeConstants.MILLIS_PER_HOUR, 2000, 2008,
                                'w', 4, 10, 0, true, 23 * DateTimeConstants.MILLIS_PER_HOUR)
        .addRecurringSavings("WINTER", 0, 2000, 2008,
                                'w', 8, 10, 0, true, 0 * DateTimeConstants.MILLIS_PER_HOUR)
        .toDateTimeZone("Zone", false);

    LocalDate date = new LocalDate(2008, 8, 10);
    assertEquals("2008-08-10", date.toString());

    DateTime dt = date.toDateTimeAtStartOfDay(zone);
    assertEquals("2008-08-10T00:00:00.000-03:00", dt.toString());
}