Package com.ibm.icu.util

Examples of com.ibm.icu.util.Calendar.clear()


    public void TestIsOn() {
        // jb 1901
        SimpleHoliday sh = new SimpleHoliday(Calendar.AUGUST, 15, "Doug's Day", 1958, 2058);
       
        Calendar gcal = new GregorianCalendar();
        gcal.clear();
        gcal.set(Calendar.YEAR, 2000);
        gcal.set(Calendar.MONTH, Calendar.AUGUST);
        gcal.set(Calendar.DAY_OF_MONTH, 15);
       
        Date d0 = gcal.getTime();
View Full Code Here


        // Get test times
        long[] times = new long[TestDates.length];
        Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("Etc/GMT"));
        for (int i = 0; i < TestDates.length; i++) {
            cal.clear();
            cal.set(TestDates[i][0], TestDates[i][1], TestDates[i][2]);
            times[i] = cal.getTimeInMillis();
        }

        for (int i = 0; i < TestZones.length; i++) {
View Full Code Here

        int[] offsets = new int[2];

        TimeZone utc = TimeZone.getTimeZone("UTC");
        Calendar cal = Calendar.getInstance(utc);
        cal.clear();

        // Set up TimeZone objects - OlsonTimeZone, SimpleTimeZone and RuleBasedTimeZone
        BasicTimeZone[] TESTZONES = new BasicTimeZone[3];

        TESTZONES[0] = (BasicTimeZone)TimeZone.getTimeZone("America/Los_Angeles", TimeZone.TIMEZONE_ICU);
View Full Code Here

        TESTZONES[2] = rbPT;

        // Calculate millis
        long [] MILLIS = new long[DATES.length];
        for (int i = 0; i < DATES.length; i++) {
            cal.clear();
            cal.set(DATES[i][0], DATES[i][1], DATES[i][2], DATES[i][3], DATES[i][4]);
            MILLIS[i] = cal.getTimeInMillis();
        }

        DateFormat df = DateFormat.getInstance();
View Full Code Here

            } else if(date.startsWith(kRELATIVE_ADD)) {
                String add = date.substring(kRELATIVE_ADD.length()); // "add" is a string indicating which fields to add
                CalendarFieldsSet addSet = new CalendarFieldsSet();
                addSet.parseFrom(add);
                useDate = true;
                cal.clear();
                cal.setTimeInMillis(now);

                /// perform op on 'to calendar'
                for (int q=0; q<addSet.fieldCount(); q++) {
                    if (addSet.isSet(q)) {
View Full Code Here

            }
           
            // run the test
            if(fmt) {
                StringBuffer output = new StringBuffer();
                cal.clear();
                FieldPosition pos = new FieldPosition(0);
                if(useDate) {
                    output = format.format(fromDate, output, pos);
                } else {
                    fromSet.setOnCalendar(cal);
View Full Code Here

                    logln(caseString + " Success - strings match: " + output);
                } else {
                    errln(caseString + " FAIL: got " + output + " expected " + str);
                }
            } else { // parse
                cal.clear();
                ParsePosition pos = new ParsePosition(0);
                format.parse(str, cal, pos);
                if(useDate) {
                    Date gotDate = cal.getTime();
                    if(gotDate.equals(fromDate)) {
View Full Code Here

        for (int i=0; i<FIELD_DATA.length; i+=2) {
            int[] fields = (int[]) FIELD_DATA[i];
            Date exp = (Date) FIELD_DATA[i+1];
           
            cal.clear();
            cal.set(Calendar.YEAR, Y);
            for (int j=0; j<fields.length; j+=2) {
                cal.set(fields[j], fields[j+1]);
            }
           
View Full Code Here

            new Integer(1), d[0], new Integer(4), d[1],
            new Integer(8), d[2], new Integer(-1), d[3],
            new Integer(-4), d[4], new Integer(-8), d[5],
        };
        for (int i=0; i<DATA.length; i+=2) {
            cal.clear();
            cal.set(Calendar.DAY_OF_WEEK_IN_MONTH,
                    ((Number) DATA[i]).intValue());
            cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
            cal.set(Calendar.MONTH, Calendar.JANUARY);
            cal.set(Calendar.YEAR, 1997);
View Full Code Here

            int d1 = DATA[i+2];
            int y2 = DATA[i+3];
            int m2 = DATA[i+4];
            int d2 = DATA[i+5];

            cal.clear();
            cal.set(y1, m1, d1);
            Date date1 = cal.getTime();
            cal.set(y2, m2, d2);
            Date date2 = cal.getTime();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.