Package java.util

Examples of java.util.TimeZone.useDaylightTime()


        System.out.println("testValue ==> " + testValue);
        System.out.println("calendar  ==> " + formatCalendarXsdWithTz(calendar, 0, timeZone));
        System.out.println("back      ==> " + back);
        // make sure that timeZone.getRawOffset() is sufficient
        assertFalse ("custom time zone should not use day light saving",
                     timeZone.useDaylightTime());
        assertEquals(testValue,
                     formatCalendarXsdWithTz(calendar, 0, timeZone));
        assertEquals("should be in timezone +05:30",
                     timeZone.getRawOffset(),
                     calendar.get(Calendar.ZONE_OFFSET)+calendar.get(Calendar.DST_OFFSET));
View Full Code Here


        System.out.println("testValue ==> " + testValue);
        System.out.println("calendar  ==> " + formatCalendarXsdWithTz(calendar, 3, timeZone));
        System.out.println("back      ==> " + back);
        // make sure that timeZone.getRawOffset() is sufficient
        assertFalse ("custom time zone should not use day light saving",
                     timeZone.useDaylightTime());
        assertEquals(testValue,
                     formatCalendarXsdWithTz(calendar, 3, timeZone));
        assertEquals("should be in timezone -05:30",
                     timeZone.getRawOffset(),
                     calendar.get(Calendar.ZONE_OFFSET)+calendar.get(Calendar.DST_OFFSET));
View Full Code Here

        System.out.println("testValue ==> " + testValue);
        System.out.println("calendar  ==> " + formatCalendarXsdWithTz(calendar, 3, timeZone));
        System.out.println("back      ==> " + back);
        // make sure that timeZone.getRawOffset() is sufficient
        assertFalse ("custom time zone should not use day light saving",
                     timeZone.useDaylightTime());
        assertEquals(testValue,
                     formatCalendarXsdWithTz(calendar, 3, timeZone));
        assertEquals("should be in timezone +05:30",
                     timeZone.getRawOffset(),
                     calendar.get(Calendar.ZONE_OFFSET)+calendar.get(Calendar.DST_OFFSET));
View Full Code Here

        int hours = offset / (60 * 60 * 1000);
        int minutes = (offset - (hours * 60 * 60 * 1000)) / (60 * 1000);

        try
        {
            if (timeZone.useDaylightTime() && timeZone.inDaylightTime(this.getDate()))
            {
                hours += sign.equals("+") ? 1 : -1;
            }
        }
        catch (ParseException e)
View Full Code Here

            if (tz == null)      return;

            // otherwise print out normally.
            int offset;
            if (tz.inDaylightTime(cal.getTime())) {
                offset = tz.getRawOffset() + (tz.useDaylightTime()?3600000:0);
            } else {
                offset = tz.getRawOffset();
            }

            if(offset==0) {
View Full Code Here

        }
        int hours = offset / (60 * 60 * 1000);
        int minutes = (offset - (hours * 60 * 60 * 1000)) / (60 * 1000);

        try {
            if (timeZone.useDaylightTime() && timeZone.inDaylightTime(this.getDate())) {
                hours += sign.equals("+") ? 1 : -1;
            }
        }
        catch (ParseException e) {
            // we'll do our best and ignore daylight savings
View Full Code Here

/*     */
/* 896 */       if (tz == null) return;
/*     */       int offset;
/*     */       int offset;
/* 900 */       if (tz.inDaylightTime(cal.getTime()))
/* 901 */         offset = tz.getRawOffset() + (tz.useDaylightTime() ? 3600000 : 0);
/*     */       else {
/* 903 */         offset = tz.getRawOffset();
/*     */       }
/*     */
/* 906 */       if (offset == 0) {
View Full Code Here

        int hours = offset / (60 * 60 * 1000);
        int minutes = (offset - (hours * 60 * 60 * 1000)) / (60 * 1000);

        try
        {
            if (timeZone.useDaylightTime() && timeZone.inDaylightTime(this.getDate()))
            {
                hours += sign.equals("+") ? 1 : -1;
            }
        }
        catch (ParseException e)
View Full Code Here

      TimeZone localTimeZone = TimeZone.getDefault();

      long sec = gmtTime / 1000L;
      long microsec = (gmtTime - (sec * 1000)) * 1000L;
      long minutesWest = localTimeZone.getRawOffset() / 1000L / 60L * -1L;
      long dstTime = localTimeZone.useDaylightTime() ? 1 : 0;

      result.put("sec", sec);
      result.put("usec", microsec);
      result.put("minuteswest", minutesWest);
      result.put("dsttime", dstTime);
View Full Code Here

    for (int i = 0; i < ids.length; i++) {
      TimeZone tz = TimeZone.getTimeZone(ids[i]);
     
      addAbbreviation(array, tz, false);
     
      if (tz.useDaylightTime())
        addAbbreviation(array, tz, true);
    }
   
    return array;
  }
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.