Examples of inDaylightTime()


Examples of java.util.TimeZone.inDaylightTime()

                    if (region.equals(TIMEZONE_REGIONS[i]))
                    {
                        TimeZone tz = TimeZone.getTimeZone(id);
                        int offset = tz.getOffset(currentTime)/60000;
                        String city = id.substring(cityPos + 1).replace('_', ' ');
                        timeZoneDetails.add(new TimeZoneDetails(id, tz.getDisplayName(tz.inDaylightTime(currentDate), TimeZone.SHORT), offset, city, region));
                        break;
                    }
                }
            }
        }
View Full Code Here

Examples of java.util.TimeZone.inDaylightTime()

        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

Examples of java.util.TimeZone.inDaylightTime()

        public String convertToString(Object value, Locale locale)
        {
            if (value instanceof Calendar) {
                Calendar cal = (Calendar)value;
                TimeZone zone = cal.getTimeZone();
                return zone.getDisplayName( zone.inDaylightTime(cal.getTime()), TimeZone.SHORT, locale);
            }

            throw new RuntimeException("Don't know how to convert " + value.getClass() + " to a String");
        }
View Full Code Here

Examples of java.util.TimeZone.inDaylightTime()

        public String convertToString(Object value, Locale locale)
        {
            if (value instanceof Calendar) {
                Calendar cal = (Calendar)value;
                TimeZone zone = cal.getTimeZone();
                return zone.getDisplayName( zone.inDaylightTime(cal.getTime()), TimeZone.SHORT, locale);
            }

            throw new RuntimeException("Don't know how to convert " + value.getClass() + " to a String");
        }
View Full Code Here

Examples of java.util.TimeZone.inDaylightTime()

        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

Examples of java.util.TimeZone.inDaylightTime()

  /**
   * Shows the current time zone (based on the current time) short name
   */
  private static String getShortTZName() {
    TimeZone tz = TimeZone.getDefault();
    return tz.getDisplayName(tz.inDaylightTime(new Date()), TimeZone.SHORT);
  }
 
  /**
   * Converts a unix timestamp in UTC to one that is relative to the local timezone
   */
 
View Full Code Here

Examples of java.util.TimeZone.inDaylightTime()

      int gmtoff = Integer.parseInt(
        line.substring(start3 + 8, line.length()));

      harness.debug("Zone " + zone + " " + d +
        " isdst=" + isdst +
        " inDaylightTime=" + tz.inDaylightTime(d));
      harness.check(tz.inDaylightTime(d) == (isdst != 0));

      harness.debug("Zone " + zone + " " + d +
        " gmtoff=" + gmtoff +
        " getOffset=" + tz.getOffset(d.getTime()));
View Full Code Here

Examples of java.util.TimeZone.inDaylightTime()

        line.substring(start3 + 8, line.length()));

      harness.debug("Zone " + zone + " " + d +
        " isdst=" + isdst +
        " inDaylightTime=" + tz.inDaylightTime(d));
      harness.check(tz.inDaylightTime(d) == (isdst != 0));

      harness.debug("Zone " + zone + " " + d +
        " gmtoff=" + gmtoff +
        " getOffset=" + tz.getOffset(d.getTime()));
      harness.check(tz.getOffset(d.getTime()) == gmtoff * 1000);
 
View Full Code Here

Examples of java.util.TimeZone.inDaylightTime()

      -12600000, "Canada/Newfoundland",
      Calendar.MARCH, 8, -Calendar.SUNDAY, 60000,
      Calendar.NOVEMBER, 1, -Calendar.SUNDAY, 60000);

    cal.set(2037, Calendar.NOVEMBER, 1, 2, 30, 0);
    harness.check(tz1.inDaylightTime(new Date(cal.getTimeInMillis())));

    cal.set(2037, Calendar.NOVEMBER, 1, 2, 31, 0);
    harness.check(!tz1.inDaylightTime(new Date(cal.getTimeInMillis())));

    cal.set(2038, Calendar.JANUARY, 1, 2, 29, 0);
View Full Code Here

Examples of java.util.TimeZone.inDaylightTime()

    cal.set(2037, Calendar.NOVEMBER, 1, 2, 30, 0);
    harness.check(tz1.inDaylightTime(new Date(cal.getTimeInMillis())));

    cal.set(2037, Calendar.NOVEMBER, 1, 2, 31, 0);
    harness.check(!tz1.inDaylightTime(new Date(cal.getTimeInMillis())));

    cal.set(2038, Calendar.JANUARY, 1, 2, 29, 0);
    harness.check(!tz1.inDaylightTime(new Date(cal.getTimeInMillis())));

    harness.checkPoint("test 2");
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.