/external/apache-harmony/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/ |
GregorianCalendarTest.java | 558 GregorianCalendar cal = new GregorianCalendar(); local 561 cal.roll(Calendar.ZONE_OFFSET, true); 568 cal.roll(Calendar.DST_OFFSET, true); 575 cal.set(2004, Calendar.DECEMBER, 31, 5, 0, 0); 576 cal.roll(Calendar.WEEK_OF_YEAR, true); 577 assertEquals("Wrong year: " + cal.getTime(), 2004, cal 579 assertEquals("Wrong month: " + cal.getTime(), Calendar.JANUARY, cal 581 assertEquals("Wrong date: " + cal.getTime(), 9, cal.get(Calendar.DATE)) [all...] |
/external/apache-harmony/text/src/test/java/org/apache/harmony/text/tests/java/text/ |
DateFormatTest.java | 435 Calendar cal = Calendar.getInstance(); local 436 format.setCalendar(cal); 437 assertTrue("Not identical Calendar", cal == format.getCalendar());
|
/external/chromium_org/third_party/icu/source/test/cintltst/ |
utmstest.c | 447 UCalendar *cal; local 455 cal = ucal_open(utc, -1, "", UCAL_GREGORIAN, &errorCode); 456 ucal_setGregorianChange(cal, -1000000 * (dayMillis * (UDate)1), &errorCode); 459 ucal_close(cal); 466 ucal_clear(cal); 467 ucal_setDate(cal, dt->year, dt->month - 1, dt->day, &errorCode); /* Java & ICU use January = month 0. */ 468 icuDate = ucal_getMillis(cal, &errorCode); 484 ucal_close(cal);
|
cmsgtst.c | 374 UCalendar *cal; local 390 cal=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_TRADITIONAL, &status); 395 ucal_setDateTime(cal, 1999, UCAL_MARCH, 18, 0, 0, 0, &status); 396 d1=ucal_getMillis(cal, &status); 460 ucal_close(cal); 476 UCalendar *cal; local 492 cal=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_TRADITIONAL, &status); 496 ucal_setDateTime(cal, 1999, UCAL_MARCH, 18, 0, 0, 0, &status); 497 d1=ucal_getMillis(cal, &status); 553 ucal_close(cal); 570 UCalendar *cal; local [all...] |
/external/chromium_org/third_party/icu/source/test/intltest/ |
astrotst.cpp | 151 GregorianCalendar *cal = new GregorianCalendar(1958, UCAL_AUGUST, 15,status); local 152 UDate then = cal->getTime(status); 201 delete cal; 270 GregorianCalendar *cal = new GregorianCalendar(tz->clone(), Locale::getUS(), status); local 272 cal->clear(); 273 cal->set(UCAL_YEAR, 2001); 274 cal->set(UCAL_MONTH, UCAL_APRIL); 275 cal->set(UCAL_DAY_OF_MONTH, 1); 276 cal->set(UCAL_HOUR_OF_DAY, 12); // must be near local noon for getSunRiseSet to work 291 astro3->setDate(cal->getTime(status)) [all...] |
callimts.cpp | 52 CalendarLimitTest::test(UDate millis, U_NAMESPACE_QUALIFIER Calendar* cal, U_NAMESPACE_QUALIFIER DateFormat* fmt) 58 cal->setTime(millis, exception); 66 logln(UnicodeString(" ") + theDate + " " + CalendarTest::calToStr(*cal)); 99 Calendar *cal = Calendar::createInstance(status); local 101 cal->adoptTimeZone(TimeZone::createTimeZone("GMT")); 103 if(!fmt || !cal) { 104 dataerrln("can't open cal and/or fmt"); 107 fmt->adoptCalendar(cal); 119 test(m, cal, fmt); 123 test(m, cal, fmt) 176 Calendar *cal = Calendar::createInstance(buf, status); local [all...] |
dtfmapts.cpp | 227 const Calendar *cal = def->getCalendar(); local 228 Calendar *newCal = cal->clone();
|
incaltst.cpp | 152 void IntlCalendarTest::quasiGregorianTest(Calendar& cal, const Locale& gcl, const int32_t *data) { 164 int32_t tz1 = cal.get(UCAL_ZONE_OFFSET,status); 167 errln((UnicodeString)"cal's tz " + tz1 + " != grego's tz " + tz2); 181 cal.clear(); 182 cal.set(UCAL_ERA, era); 183 cal.set(year, month, dayOfMonth); 184 UDate d = cal.getTime(status); 186 logln((UnicodeString)"cal : " + CalendarTest::calToStr(cal)); 191 " => " + d + " (" + UnicodeString(cal.getType()) + ")") 235 Calendar *cal; local 287 Calendar *cal; local 338 Calendar *cal; local 392 Calendar *cal; local 492 Calendar *cal; local 617 Calendar *cal; local 720 Calendar *cal; local [all...] |
tzfmttst.cpp | 56 Calendar *cal = Calendar::createInstance(TimeZone::createTimeZone((UnicodeString)"UTC"), status); local 64 cal->set(1900, UCAL_JANUARY, 1); 65 low = cal->getTime(status); 66 cal->set(2040, UCAL_JANUARY, 1); 67 high = cal->getTime(status); 76 cal->clear(); 78 cal->set(testDateData[i][0], testDateData[i][1], testDateData[i][2]); 79 DATES[i] = cal->getTime(status); 238 delete cal; 449 Calendar *cal = Calendar::createInstance(TimeZone::createTimeZone((UnicodeString) "UTC"), status) local [all...] |
/external/chromium_org/third_party/icu/source/test/perf/DateFmtPerf/ |
DateFmtPerf.h | 162 Calendar *cal; local 167 cal = Calendar::createInstance(status2); 170 cal->adoptTimeZone(zone); 182 cal->clear(); 183 cal->set(years[i], months[i], days[i]); 184 date = cal->getTime(status2); 187 fmt->setCalendar(*cal); 201 delete cal;
|
/external/chromium_org/third_party/icu/source/tools/toolutil/ |
toolutil.cpp | 72 UCalendar *cal = NULL; local 75 cal = ucal_open(NULL, -1, NULL, UCAL_TRADITIONAL, &status); 76 ucal_setMillis(cal, ucal_getNow(), &status); 77 currentYear = ucal_get(cal, UCAL_YEAR, &status); 78 ucal_close(cal);
|
/external/icu4c/samples/cal/ |
cal.c | 43 static void cal(int32_t month, int32_t year, 83 /* The version of cal */ 143 printf("cal: invalid option -- %s\n", arg+1); 146 /* done with options, display cal */ 189 /* print the cal */ 190 cal(month, year, useLongNames, &status); 206 puts(" -v, --version Print the version number of cal and exit."); 226 cal(int32_t month, function
|
/external/icu4c/test/cintltst/ |
utmstest.c | 447 UCalendar *cal; local 455 cal = ucal_open(utc, -1, "", UCAL_GREGORIAN, &errorCode); 456 ucal_setGregorianChange(cal, -1000000 * (dayMillis * (UDate)1), &errorCode); 459 ucal_close(cal); 466 ucal_clear(cal); 467 ucal_setDate(cal, dt->year, dt->month - 1, dt->day, &errorCode); /* Java & ICU use January = month 0. */ 468 icuDate = ucal_getMillis(cal, &errorCode); 484 ucal_close(cal);
|
/external/icu4c/test/intltest/ |
astrotst.cpp | 151 GregorianCalendar *cal = new GregorianCalendar(1958, UCAL_AUGUST, 15,status); local 152 UDate then = cal->getTime(status); 201 delete cal; 270 GregorianCalendar *cal = new GregorianCalendar(tz->clone(), Locale::getUS(), status); local 272 cal->clear(); 273 cal->set(UCAL_YEAR, 2001); 274 cal->set(UCAL_MONTH, UCAL_APRIL); 275 cal->set(UCAL_DAY_OF_MONTH, 1); 276 cal->set(UCAL_HOUR_OF_DAY, 12); // must be near local noon for getSunRiseSet to work 291 astro3->setDate(cal->getTime(status)) [all...] |
callimts.cpp | 52 CalendarLimitTest::test(UDate millis, icu::Calendar* cal, icu::DateFormat* fmt) 58 cal->setTime(millis, exception); 66 logln(UnicodeString(" ") + theDate + " " + CalendarTest::calToStr(*cal)); 99 Calendar *cal = Calendar::createInstance(status); local 101 cal->adoptTimeZone(TimeZone::createTimeZone("GMT")); 103 if(!fmt || !cal) { 104 dataerrln("can't open cal and/or fmt"); 107 fmt->adoptCalendar(cal); 119 test(m, cal, fmt); 123 test(m, cal, fmt) 177 Calendar *cal = Calendar::createInstance(buf, status); local [all...] |
dadrfmt.cpp | 181 Calendar *cal = Calendar::createInstance(loc, status); local 188 cal->setTimeZone(*tz); 209 cal->clear(); 210 cal->setTime(now, status); 213 //int32_t oldv = cal->get((UCalendarDateFields)q, status); 215 cal->add((UCalendarDateFields)q, 218 cal->set((UCalendarDateFields)q, 221 //int32_t newv = cal->get((UCalendarDateFields)q, status); 224 fromDate = cal->getTime(status); 239 cal->clear() [all...] |
dtfmapts.cpp | 227 const Calendar *cal = def->getCalendar(); local 228 Calendar *newCal = cal->clone();
|
/external/icu4c/test/perf/DateFmtPerf/ |
DateFmtPerf.h | 163 Calendar *cal; local 168 cal = Calendar::createInstance(status2); 171 cal->adoptTimeZone(zone); 183 cal->clear(); 184 cal->set(years[i], months[i], days[i]); 185 date = cal->getTime(status2); 188 fmt->setCalendar(*cal); 202 delete cal;
|
/external/icu4c/tools/toolutil/ |
toolutil.cpp | 76 UCalendar *cal = NULL; local 79 cal = ucal_open(NULL, -1, NULL, UCAL_TRADITIONAL, &status); 80 ucal_setMillis(cal, ucal_getNow(), &status); 81 currentYear = ucal_get(cal, UCAL_YEAR, &status); 82 ucal_close(cal);
|
/libcore/luni/src/main/java/javax/xml/datatype/ |
Duration.java | 333 Calendar cal = (Calendar) startInstant.clone(); local 334 addTo(cal); 335 return getCalendarTimeInMillis(cal) 371 Calendar cal = new GregorianCalendar(); local 372 cal.setTime(startInstant); 373 this.addTo(cal); 374 return getCalendarTimeInMillis(cal) - startInstant.getTime(); 558 Calendar cal = new GregorianCalendar(); local 559 cal.setTime(date); 560 this.addTo(cal); [all...] |
/libcore/luni/src/test/java/tests/api/java/util/ |
SimpleTimeZoneTest.java | 802 Calendar cal = Calendar.getInstance(); local 803 cal.set(1998, Calendar.NOVEMBER, 11, 0, 0); 806 assertTrue("Incorrect offset returned", st1.getOffset(cal.getTimeInMillis()) == 810 cal.set(1998, Calendar.JUNE, 11, 0, 0); 812 .getOffset(cal.getTimeInMillis())); [all...] |
/packages/apps/Bluetooth/tests/src/com/android/bluetooth/tests/ |
BluetoothMapbMessageTest.java | 127 Calendar cal = Calendar.getInstance(); local 128 int offset = (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / (15 * 60 * 1000); /* offset in quarters of an hour */
|
/packages/apps/Contacts/src/com/android/contacts/editor/ |
EventFieldEditorView.java | 211 Calendar cal = DateUtils.parseDate(oldValue, false); local 212 if (cal != null) { 213 if (DateUtils.isYearSet(cal)) { 214 oldYear = cal.get(Calendar.YEAR); 216 //cal.set(Calendar.YEAR, 0); 219 oldMonth = cal.get(Calendar.MONTH); 220 oldDay = cal.get(Calendar.DAY_OF_MONTH);
|
/packages/apps/ContactsCommon/src/com/android/contacts/common/util/ |
DateUtils.java | 122 public static boolean isYearSet(Calendar cal) { 126 return cal.get(Calendar.YEAR) > 1; 162 final Calendar cal = parseDate(string, false); local 165 if (cal == null) { 169 final boolean isYearSet = isYearSet(cal); 180 return outFormat.format(cal.getTime());
|
/packages/apps/Exchange/tests/src/com/android/exchange/utility/ |
CalendarUtilitiesTests.java | 220 GregorianCalendar cal = new GregorianCalendar(); local 221 cal.setTimeInMillis(dateTime); 222 cal.setTimeZone(TimeZone.getTimeZone("GMT")); 223 assertEquals(cal.get(Calendar.YEAR), 2010); 224 assertEquals(cal.get(Calendar.MONTH), 1); // 0 based 225 assertEquals(cal.get(Calendar.DAY_OF_MONTH), 23); 226 assertEquals(cal.get(Calendar.HOUR_OF_DAY), 16); 227 assertEquals(cal.get(Calendar.MINUTE), 16); 228 assertEquals(cal.get(Calendar.SECOND), 17); 235 GregorianCalendar cal = new GregorianCalendar() local [all...] |