Search in sources :

Example 71 with SimpleTimeZone

use of java.util.SimpleTimeZone in project j2objc by google.

the class SimpleTimeZoneTest method testDstParis2014_SundayAfter25thMarch_SundayAfter25thOctober_UtcTime.

public void testDstParis2014_SundayAfter25thMarch_SundayAfter25thOctober_UtcTime() {
    TimeZone timeZone = new SimpleTimeZone(PARIS_RAW_OFFSET, "Europe/Paris", Calendar.MARCH, 25, -Calendar.SUNDAY, 3600000, SimpleTimeZone.UTC_TIME, Calendar.OCTOBER, 25, -Calendar.SUNDAY, 3600000, SimpleTimeZone.UTC_TIME, 3600000);
    checkDstParis2014(timeZone);
}
Also used : TimeZone(java.util.TimeZone) SimpleTimeZone(java.util.SimpleTimeZone) SimpleTimeZone(java.util.SimpleTimeZone)

Example 72 with SimpleTimeZone

use of java.util.SimpleTimeZone in project j2objc by google.

the class SimpleTimeZoneTest method testDst_1stSundayApril_1stSundayOctober_DefaultTime.

public void testDst_1stSundayApril_1stSundayOctober_DefaultTime() {
    TimeZone timeZone = new SimpleTimeZone(-18000000, "EST", Calendar.APRIL, 1, -Calendar.SUNDAY, 7200000, Calendar.OCTOBER, -1, Calendar.SUNDAY, 7200000, 3600000);
    checkDstTransitionTimes(timeZone, 1998, "1998-04-05T07:00:00.000+0000", "1998-10-25T06:00:00.000+0000");
    checkDstTransitionTimes(timeZone, 2014, "2014-04-06T07:00:00.000+0000", "2014-10-26T06:00:00.000+0000");
}
Also used : TimeZone(java.util.TimeZone) SimpleTimeZone(java.util.SimpleTimeZone) SimpleTimeZone(java.util.SimpleTimeZone)

Example 73 with SimpleTimeZone

use of java.util.SimpleTimeZone in project j2objc by google.

the class SimpleTimeZoneTest method testDstNewYork2014_9thMarch_2ndNovember_UtcTime.

public void testDstNewYork2014_9thMarch_2ndNovember_UtcTime() {
    TimeZone timeZone = new SimpleTimeZone(NEW_YORK_RAW_OFFSET, "EST", Calendar.MARCH, 9, 0, 25200000, SimpleTimeZone.UTC_TIME, Calendar.NOVEMBER, 2, 0, 21600000, SimpleTimeZone.UTC_TIME, 3600000);
    checkDstNewYork2014(timeZone);
}
Also used : TimeZone(java.util.TimeZone) SimpleTimeZone(java.util.SimpleTimeZone) SimpleTimeZone(java.util.SimpleTimeZone)

Example 74 with SimpleTimeZone

use of java.util.SimpleTimeZone in project j2objc by google.

the class TimeZoneTest method test_clone_SimpleTimeZone.

// http://code.google.com/p/android/issues/detail?id=11542
public void test_clone_SimpleTimeZone() {
    SimpleTimeZone stz = new SimpleTimeZone(21600000, "Central Standard Time");
    stz.setStartYear(1000);
    stz.inDaylightTime(new Date());
    stz.clone();
}
Also used : SimpleTimeZone(java.util.SimpleTimeZone) Date(java.util.Date)

Example 75 with SimpleTimeZone

use of java.util.SimpleTimeZone in project j2objc by google.

the class TimeZoneTest method testCustomTimeZoneDisplayNames.

// http://b/3049014
public void testCustomTimeZoneDisplayNames() {
    TimeZone tz0001 = new SimpleTimeZone(60000, "ONE MINUTE");
    TimeZone tz0130 = new SimpleTimeZone(5400000, "ONE HOUR, THIRTY");
    TimeZone tzMinus0130 = new SimpleTimeZone(-5400000, "NEG ONE HOUR, THIRTY");
    assertEquals("GMT+00:01", tz0001.getDisplayName(false, TimeZone.SHORT, Locale.US));
    assertEquals("GMT+01:30", tz0130.getDisplayName(false, TimeZone.SHORT, Locale.US));
    assertEquals("GMT-01:30", tzMinus0130.getDisplayName(false, TimeZone.SHORT, Locale.US));
}
Also used : TimeZone(java.util.TimeZone) SimpleTimeZone(java.util.SimpleTimeZone) SimpleTimeZone(java.util.SimpleTimeZone)

Aggregations

SimpleTimeZone (java.util.SimpleTimeZone)114 TimeZone (java.util.TimeZone)42 GregorianCalendar (java.util.GregorianCalendar)34 Date (java.util.Date)25 SimpleDateFormat (java.text.SimpleDateFormat)20 Calendar (java.util.Calendar)8 Test (org.junit.Test)7 BasicDBObject (com.mongodb.BasicDBObject)3 BSONTimestamp (org.bson.types.BSONTimestamp)3 Code (org.bson.types.Code)3 CodeWScope (org.bson.types.CodeWScope)3 ObjectId (org.bson.types.ObjectId)3 Support_TimeZone (tests.support.Support_TimeZone)3 DBRef (com.mongodb.DBRef)2 IOException (java.io.IOException)2 InvalidObjectException (java.io.InvalidObjectException)2 DateFormat (java.text.DateFormat)2 ParsePosition (java.text.ParsePosition)2 Binary (org.bson.types.Binary)2 MaxKey (org.bson.types.MaxKey)2