/external/icu/icu4c/source/samples/datecal/ |
H A D | ccal.c | 20 UCalendar *cal = ucal_open(NULL, -1, NULL, UCAL_GREGORIAN, &status); local 26 ucal_set(cal, UCAL_YEAR, 2000); 27 ucal_set(cal, UCAL_MONTH, UCAL_FEBRUARY); /* FEBRUARY */ 28 ucal_set(cal, UCAL_DATE, 26); 29 ucal_set(cal, UCAL_HOUR_OF_DAY, 23); 30 ucal_set(cal, UCAL_MINUTE, 0); 31 ucal_set(cal, UCAL_SECOND, 0); 32 ucal_set(cal, UCAL_MILLISECOND, 0); 38 ucal_get(cal, UCAL_YEAR, &status), 39 ucal_get(cal, UCAL_MONT [all...] |
H A D | Makefile | 15 OBJECTS=cal.o ccal.o
|
/external/icu/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/ |
H A D | CompatibilityTest.java | 72 GregorianCalendar cal = new GregorianCalendar(gmt); 97 cal.setTime(d); 98 int y = cal.get(Calendar.YEAR), mon = cal.get(Calendar.MONTH)+1-Calendar.JANUARY, 99 dom = cal.get(Calendar.DATE), dow = cal.get(Calendar.DAY_OF_WEEK); 116 GregorianCalendar cal = 126 cal.setGregorianChange(type==0 ? PURE_GREGORIAN : PURE_JULIAN); 127 fmt.setCalendar(cal); 150 cal 250 auxMapping(Calendar cal, int y, int m, int d) argument 1009 marchByDelta(Calendar cal, int delta) argument [all...] |
H A D | CalendarTest.java | 73 public void doTestCases(TestCase[] cases, Calendar cal) argument 75 cal.setTimeZone(UTC); 78 DateFormat format = DateFormat.getDateTimeInstance(cal, DateFormat.SHORT, -1, Locale.getDefault()); 80 final String pattern = (cal instanceof ChineseCalendar) ? 107 test.applyTime(cal); 108 if (!test.fieldsEqual(cal, this)) { 111 format.format(cal.getTime()) + 120 cal.clear(); 121 test.applyFields(cal); 122 if (!test.equals(cal)) { 156 doRollAdd(boolean roll, Calendar cal, int[][] tests) argument 223 doLimitsTest(Calendar cal, int[] fieldsToTest, Date startDate, int testDuration) argument 343 doLimitsTest(Calendar cal, int[] fieldsToTest, Date startDate) argument 354 doTheoreticalLimitsTest(Calendar cal, boolean leapMonth) argument 425 ymdToString(Calendar cal) argument 438 getJulianDay(Calendar cal) argument [all...] |
H A D | ChineseTest.java | 92 ChineseCalendar cal = new ChineseCalendar(); 102 cal.setTime(date); 103 int y = cal.get(Calendar.EXTENDED_YEAR); 104 int m = cal.get(Calendar.MONTH)+1; // 0-based -> 1-based 105 int L = cal.get(Calendar.IS_LEAP_MONTH); 106 int d = cal.get(Calendar.DAY_OF_MONTH); 130 cal.clear(); 131 cal.set(Calendar.EXTENDED_YEAR, cyear); 132 cal.set(Calendar.MONTH, cmonth-1); 133 cal 480 doRollAdd(boolean roll, ChineseCalendar cal, int[][] tests) argument [all...] |
H A D | DangiTest.java | 72 Calendar cal = Calendar.getInstance(new ULocale("ko_KR@calendar=dangi")); 82 cal.setTime(date); 83 int y = cal.get(Calendar.EXTENDED_YEAR); 84 int m = cal.get(Calendar.MONTH) + 1; // 0-based -> 1-based 85 int L = cal.get(Calendar.IS_LEAP_MONTH); 86 int d = cal.get(Calendar.DAY_OF_MONTH); 109 cal.clear(); 110 cal.set(Calendar.EXTENDED_YEAR, cyear); 111 cal.set(Calendar.MONTH, cmonth - 1); 112 cal 343 doRollAddDangi(boolean roll, Calendar cal, int[][] tests) argument [all...] |
H A D | IndianTest.java | 108 IndianCalendar cal = new IndianCalendar(); 109 cal.clear(); 110 cal.set(1000, 0, 30); 112 cal.get(YEAR) + "/" + 113 cal.get(MONTH) + "/" + 114 cal.get(DATE)); 115 cal.clear(); 116 cal.set(1, 0, 30); 118 cal.get(YEAR) + "/" + 119 cal [all...] |
H A D | EthiopicTest.java | 65 EthiopicCalendar cal = newCivil(); 67 doRollAdd(ROLL, cal, tests); 236 EthiopicCalendar cal = new EthiopicCalendar(1, 0, 1); 237 assertEquals("Ethiopic Date", "Wed Jan 01, 0001 AD", fmt.format(cal)); 239 cal.set(Calendar.ERA, 0); 240 cal.set(Calendar.YEAR, 5500); 241 assertEquals("Ethiopic Date", "Tue Jan 01, 5500 BC", fmt.format(cal)); 251 gc.setTime(cal.getTime()); 257 EthiopicCalendar cal = new EthiopicCalendar(); 258 cal [all...] |
H A D | HebrewTest.java | 79 HebrewCalendar cal = new HebrewCalendar(UTC, Locale.getDefault()); 81 doRollAdd(ROLL, cal, tests); 117 HebrewCalendar cal = new HebrewCalendar(UTC, Locale.getDefault()); 119 doRollAdd(ADD, cal, tests); 256 HebrewCalendar cal = new HebrewCalendar(); 262 cal.clear(); 264 cal.set(Calendar.YEAR, year); 265 cal.set(Calendar.MONTH, ELUL); 266 cal.set(Calendar.DAY_OF_MONTH, 1); 268 int yact = cal [all...] |
H A D | CalendarRegression.java | 80 GregorianCalendar cal = new GregorianCalendar(zone); 81 cal.clear(); 82 cal.set(1900, 15, 5, 5, 8, 13); 83 if (cal.get(Calendar.HOUR) != 5) { 86 cal.get(Calendar.DST_OFFSET) / (60*60*1000.0) + "; ZONE_OFFSET = " + 87 cal.get(Calendar.ZONE_OFFSET) / (60*60*1000.0) + "; getRawOffset() = " + 89 "; HOUR = " + cal.get(Calendar.HOUR)); 90 cal.clear(); 91 cal.set(1900, 15, 5, 5, 8, 13); 92 if (cal [all...] |
H A D | IBMCalendarTest.java | 109 Calendar cal = Calendar.getInstance(loc); 112 cal.clear(); 113 cal.set(data[i], data[i+1], data[i+2], data[i+3], 0, 0); 115 cal.setTime(new Date(cal.getTime().getTime() + data[i+4])); 117 boolean isWeekend = cal.isWeekend(); 120 logln("Ok: " + fmt.format(cal.getTime()) + " isWeekend=" + isWeekend); 122 errln("FAIL: " + fmt.format(cal.getTime()) + " isWeekend=" + isWeekend + 132 Calendar cal = Calendar.getInstance(loc); 134 int type = cal 153 quasiGregorianTest(Calendar cal, int[] data) argument 1120 setTo(Calendar cal) argument 1144 isEquivalentTo(Calendar cal) argument 1154 createFrom(Calendar cal) argument [all...] |
H A D | CopticTest.java | 144 CopticCalendar cal = new CopticCalendar(); 145 cal.clear(); 150 cal.set(Calendar.JULIAN_DAY, jd); 151 int eyear = cal.get(Calendar.EXTENDED_YEAR); 152 int month = cal.get(Calendar.MONTH); 153 int day = cal.get(Calendar.DAY_OF_MONTH); 177 CopticCalendar cal = new CopticCalendar(1, 0, 1); 178 assertEquals("Coptic Date", "Fri Jan 01, 0001 AD", copticFmt.format(cal)); 179 assertEquals("Gregorian Date", "Fri Aug 29, 0284 AD", fmt.format(cal.getTime())); 181 cal [all...] |
/external/icu/icu4c/source/test/intltest/ |
H A D | callimts.cpp | 52 CalendarLimitTest::test(UDate millis, icu::Calendar* cal, icu::DateFormat* fmt) argument 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, fm 177 Calendar *cal = Calendar::createInstance(buf, status); local 195 doTheoreticalLimitsTest(Calendar& cal, UBool leapMonth) argument 266 doLimitsTest(Calendar& cal, UDate startDate, int32_t endTime) argument 272 doLimitsTest(Calendar& cal, const int32_t* fieldsToTest, UDate startDate, int32_t testDuration) argument 459 ymdToString(const Calendar& cal, UnicodeString& str) argument [all...] |
H A D | callimts.h | 27 virtual void test(UDate millis, Calendar *cal, DateFormat *fmt); 44 * @param cal The calendar instance to be tested. 47 void doTheoreticalLimitsTest(Calendar& cal, UBool leapMonth); 51 * test calendar 'cal' through 'numberOfDays' sequential days starting 67 * @param cal the calendar to be tested 76 void doLimitsTest(Calendar& cal, const int32_t* fieldsToTest, UDate startDate, int32_t testDuration); 81 void doLimitsTest(Calendar& cal, UDate startDate, int32_t endTime); 83 UnicodeString& ymdToString(const Calendar& cal, UnicodeString& str);
|
H A D | caltztst.cpp | 183 Calendar* cal = getCalendar(); local 184 if (cal == 0) return 0.0; 185 cal->clear(); 186 cal->set(1900 + y, m, d, hr, min, sec); // Add 1900 to follow java.util.Date protocol 188 UDate dt = cal->getTime(status); 189 releaseCalendar(cal); 202 Calendar* cal = getCalendar(); 203 if (cal == 0) return 0.0; 206 cal->get(Calendar::ZONE_OFFSET, status) - 207 cal 221 Calendar* cal = getCalendar(); local [all...] |
/external/icu/icu4c/source/samples/translit/answers/ |
H A D | main_1.cpp | 19 Calendar *cal; local 27 cal = Calendar::createInstance(greece, status); 32 fmt->setCalendar(*cal); 36 defFmt->setCalendar(*cal); 44 cal->clear(); 45 cal->set(1999, month, 4); 49 defFmt->format(cal->getTime(status), str, status); 57 fmt->format(cal->getTime(status), str, status); 66 delete cal;
|
H A D | main_2.cpp | 19 Calendar *cal; local 28 cal = Calendar::createInstance(greece, status); 33 fmt->setCalendar(*cal); 37 defFmt->setCalendar(*cal); 52 cal->clear(); 53 cal->set(1999, month, 4); 57 defFmt->format(cal->getTime(status), str, status); 65 fmt->format(cal->getTime(status), str, status); 80 delete cal;
|
H A D | main_3.cpp | 30 Calendar *cal; local 40 cal = Calendar::createInstance(greece, status); 45 fmt->setCalendar(*cal); 49 defFmt->setCalendar(*cal); 71 cal->clear(); 72 cal->set(1999, month, 4); 76 defFmt->format(cal->getTime(status), str, status); 84 fmt->format(cal->getTime(status), str, status); 106 delete cal;
|
H A D | main_4.cpp | 30 Calendar *cal; local 41 cal = Calendar::createInstance(greece, status); 46 fmt->setCalendar(*cal); 50 defFmt->setCalendar(*cal); 75 cal->clear(); 76 cal->set(1999, month, 4); 80 defFmt->format(cal->getTime(status), str, status); 88 fmt->format(cal->getTime(status), str, status); 115 delete cal;
|
/external/icu/icu4c/source/samples/datefmt/answers/ |
H A D | main_3.cpp | 37 Calendar *cal; local 60 cal = Calendar::createInstance(status); 63 cal->adoptTimeZone(zone); 64 cal->clear(); 65 cal->set(1999, Calendar::JUNE, 4); 66 date = cal->getTime(status); 78 cal->adoptTimeZone(createZone(TIMEZONE[j])); 79 fmt->setCalendar(*cal);
|
/external/icu/icu4c/source/samples/datefmt/ |
H A D | main.cpp | 37 Calendar *cal; local 60 cal = Calendar::createInstance(status); 63 cal->adoptTimeZone(zone); 64 cal->clear(); 65 cal->set(1999, Calendar::JUNE, 4); 66 date = cal->getTime(status); 78 cal->adoptTimeZone(createZone(TIMEZONE[j])); 79 fmt->setCalendar(*cal);
|
/external/xmp_toolkit/XMPCore/src/com/adobe/xmp/ |
H A D | XMPDateTimeFactory.java | 113 Calendar cal = dateTime.getCalendar(); 114 cal.setTimeZone(TimeZone.getDefault()); 115 return new XMPDateTimeImpl(cal); 131 GregorianCalendar cal = new GregorianCalendar(UTC); 132 cal.setGregorianChange(new Date(Long.MIN_VALUE)); 133 cal.setTimeInMillis(timeInMillis); 134 return new XMPDateTimeImpl(cal); 149 GregorianCalendar cal = new GregorianCalendar(); 150 cal.setTimeInMillis(timeInMillis); 151 return new XMPDateTimeImpl(cal); [all...] |
/external/icu/icu4c/source/i18n/ |
H A D | ucal.cpp | 163 ucal_close(UCalendar *cal) argument 166 delete (Calendar*) cal; 170 ucal_clone(const UCalendar* cal, argument 175 Calendar* res = ((Calendar*)cal)->clone(); 186 ucal_setTimeZone( UCalendar* cal, argument 199 ((Calendar*)cal)->adoptTimeZone(zone); 204 ucal_getTimeZoneID(const UCalendar *cal, argument 212 const TimeZone& tz = ((Calendar*)cal)->getTimeZone(); 219 ucal_getTimeZoneDisplayName(const UCalendar* cal, argument 229 const TimeZone& tz = ((Calendar*)cal) 259 ucal_inDaylightTime( const UCalendar* cal, UErrorCode* status ) argument 268 ucal_setGregorianChange(UCalendar *cal, UDate date, UErrorCode *pErrorCode) argument 291 ucal_getGregorianChange(const UCalendar *cal, UErrorCode *pErrorCode) argument 313 ucal_getAttribute( const UCalendar* cal, UCalendarAttribute attr) argument 340 ucal_setAttribute( UCalendar* cal, UCalendarAttribute attr, int32_t newValue) argument 383 ucal_getMillis( const UCalendar* cal, UErrorCode* status) argument 393 ucal_setMillis( UCalendar* cal, UDate dateTime, UErrorCode* status ) argument 404 ucal_setDate( UCalendar* cal, int32_t year, int32_t month, int32_t date, UErrorCode *status) argument 418 ucal_setDateTime( UCalendar* cal, int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second, UErrorCode *status) argument 441 ucal_add( UCalendar* cal, UCalendarDateFields field, int32_t amount, UErrorCode* status) argument 453 ucal_roll( UCalendar* cal, UCalendarDateFields field, int32_t amount, UErrorCode* status) argument 465 ucal_get( const UCalendar* cal, UCalendarDateFields field, UErrorCode* status ) argument 476 ucal_set( UCalendar* cal, UCalendarDateFields field, int32_t value) argument 485 ucal_isSet( const UCalendar* cal, UCalendarDateFields field) argument 493 ucal_clearField( UCalendar* cal, UCalendarDateFields field) argument 508 ucal_getLimit( const UCalendar* cal, UCalendarDateFields field, UCalendarLimitType type, UErrorCode *status) argument 546 ucal_getLocaleByType(const UCalendar *cal, ULocDataLocaleType type, UErrorCode* status) argument 590 ucal_getType(const UCalendar *cal, UErrorCode* status) argument 599 ucal_getDayOfWeekType(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode* status) argument 608 ucal_getWeekendTransition(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode *status) argument 617 ucal_isWeekend(const UCalendar *cal, UDate date, UErrorCode *status) argument 626 ucal_getFieldDifference(UCalendar* cal, UDate target, UCalendarDateFields field, UErrorCode* status ) argument 752 ucal_getTimeZoneTransitionDate(const UCalendar* cal, UTimeZoneTransitionType type, UDate* transition, UErrorCode* status) argument [all...] |
/external/icu/icu4c/source/samples/translit/ |
H A D | main.cpp | 30 Calendar *cal; local 42 cal = Calendar::createInstance(greece, status); 47 fmt->setCalendar(*cal); 51 defFmt->setCalendar(*cal); 77 cal->clear(); 78 cal->set(1999, month, 4); 82 defFmt->format(cal->getTime(status), str, status); 90 fmt->format(cal->getTime(status), str, status); 117 delete cal;
|
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/util/ |
H A D | EasterHoliday.java | 243 private Date computeInYear(Date date, GregorianCalendar cal) argument 245 if (cal == null) cal = calendar; 247 synchronized(cal) { 248 cal.setTime(date); 250 int year = cal.get(Calendar.YEAR); 255 if (cal.getTime().after( cal.getGregorianChange())) 273 cal.clear(); 274 cal [all...] |