Package java.util

Examples of java.util.GregorianCalendar.clear()


        ContentStream content3 = createContent("I have a dog.");
        doc3 = createDocument("gamma", rootFolderId, COMPLEX_TYPE, propertyMap3, content3);
        assertNotNull(doc3);

        final GregorianCalendar gc4 = new GregorianCalendar(TZ);
        gc4.clear();
        gc4.set(2038, 0, 20);

        final Map<String, Object> propertyMap4 =
            new HashMap<String, Object>() {
            {
View Full Code Here


        ContentStream content4 = createContent("I have a cat and a dog.");
        doc4 = createDocument("delta", rootFolderId, COMPLEX_TYPE, propertyMap4, content4);
        assertNotNull(doc4);

        final GregorianCalendar gc5 = new GregorianCalendar(TZ);
        gc5.clear();
        gc5.set(2345, 6, 14);

        final Map<String, Object> propertyMap5 =
            new HashMap<String, Object>() {
            {
View Full Code Here

        final int DEFAULT_TIMEZONE_OFFSET = DatatypeConstants.FIELD_UNDEFINED;
        TimeZone tz = getTimeZone(DEFAULT_TIMEZONE_OFFSET);
        Locale locale = java.util.Locale.getDefault();

        result = new GregorianCalendar(tz, locale);
        result.clear();
        result.setGregorianChange(PURE_GREGORIAN_CHANGE);

        // if year( and eon) are undefined, leave default Calendar values
        if (year != DatatypeConstants.FIELD_UNDEFINED) {
            if (eon == null) {
View Full Code Here

        }
        if (aLocale == null) {
            aLocale = java.util.Locale.getDefault();
        }
        result = new GregorianCalendar(tz, aLocale);
        result.clear();
        result.setGregorianChange(PURE_GREGORIAN_CHANGE);

        // if year( and eon) are undefined, leave default Calendar values
        if (year != DatatypeConstants.FIELD_UNDEFINED) {
            if (eon == null) {
View Full Code Here

      }
    }

    Calendar dateTime = new GregorianCalendar(GMT);

    dateTime.clear();
    dateTime.set(Integer.valueOf(m.group(1)),
                 Integer.valueOf(m.group(2)) - 1,
                 Integer.valueOf(m.group(3)),
                 Integer.valueOf(m.group(4)),
                 Integer.valueOf(m.group(5)),
View Full Code Here

      }
    }

    Calendar dateTime = new GregorianCalendar(GMT);

    dateTime.clear();
    dateTime.set(Integer.valueOf(m.group(1)),
                 Integer.valueOf(m.group(2)) - 1,
                 Integer.valueOf(m.group(3)));

    ret.value = dateTime.getTimeInMillis();
View Full Code Here

     */
    public long toJavaMillis() {
        // Force use of the Gregorian calendar in UTC and manually offset hours later.
        // Mainly because it isn't convenient to create a TimeZone from a UTC/GMT offset.
        Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
        cal.clear(); // kills milliseconds or any other partial crap.
        cal.set(year + 1900, month - 1, day, hour, minute, second);

        // GMT offset in 15 minute intervals.
        // Example, if offset is GMT+10, the value will be +40, and we need to subtract 600 minutes.
        cal.add(Calendar.MINUTE, -gmtOffset * 15);
 
View Full Code Here

         calNow.clear(Calendar.HOUR_OF_DAY);
         calNow.clear(Calendar.MINUTE);
         calNow.clear(Calendar.SECOND);
         calNow.clear(Calendar.MILLISECOND);

         calLast.clear(Calendar.AM_PM);
         calLast.clear(Calendar.HOUR);
         calLast.clear(Calendar.HOUR_OF_DAY);
         calLast.clear(Calendar.MINUTE);
         calLast.clear(Calendar.SECOND);
         calLast.clear(Calendar.MILLISECOND);
View Full Code Here

         calNow.clear(Calendar.MINUTE);
         calNow.clear(Calendar.SECOND);
         calNow.clear(Calendar.MILLISECOND);

         calLast.clear(Calendar.AM_PM);
         calLast.clear(Calendar.HOUR);
         calLast.clear(Calendar.HOUR_OF_DAY);
         calLast.clear(Calendar.MINUTE);
         calLast.clear(Calendar.SECOND);
         calLast.clear(Calendar.MILLISECOND);
View Full Code Here

         calNow.clear(Calendar.SECOND);
         calNow.clear(Calendar.MILLISECOND);

         calLast.clear(Calendar.AM_PM);
         calLast.clear(Calendar.HOUR);
         calLast.clear(Calendar.HOUR_OF_DAY);
         calLast.clear(Calendar.MINUTE);
         calLast.clear(Calendar.SECOND);
         calLast.clear(Calendar.MILLISECOND);

         long millisPerDay = 86400000; // 24 * 60 * 60 * 1000
 
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.