Package java.util

Examples of java.util.TimeZone$DisplayNames


  /// @method getLastModified
  /// Gets the time of last modification.
  /// @synopsis Calendar getLastModified()
  public Any m_getLastModified(Context context)
  {
    TimeZone tz = context.getTimeZone();
    Locale lc = context.getLocale();
    Calendar cal = Calendar.getInstance(tz, lc);
    cal.setTime(new Date(_resource.getLastModified()));
    return new anvil.core.time.AnyCalendar(cal);
  }
View Full Code Here


  /// @synopsis Calendar getTime(string timezone)
  /// @synopsis Calendar getTime(string timezone, string locale)
  public static final Object[] p_getTime = { null, "*timezone", null, "*locale", null };
  public static final Any getTime(Context context, String timezone, String locale)
  {
    TimeZone tz;
    Locale lc;
    if (timezone == null) {
      tz = context.getTimeZone();
    } else {
      tz = TimeZone.getTimeZone(timezone);
View Full Code Here

 
  public static String dateTimeToString(final Date date) {
    if (date == null) {
      return "";
    }
    TimeZone tz = getTimeZone();
    if (!tz.equals(dateTimeFormatter.getTimeZone())) {
      dateTimeFormatter.setTimeZone(tz);
    }
    return dateTimeFormatter.format(date);
  }
View Full Code Here

 
  public static String timeToString(final Date date) {
    if (date == null) {
      return "";
    }
    TimeZone tz = getTimeZone();
    if (!tz.equals(timeFormatter.getTimeZone())) {
      timeFormatter.setTimeZone(tz);
    }
    return timeFormatter.format(date);
  }
View Full Code Here

    }
    return timeFormatter.format(date);
  }

  public static Date dateTimeToDate(final String str) throws ParseException {
    TimeZone tz = getTimeZone();
    if (!tz.equals(dateTimeFormatter.getTimeZone())) {
      dateTimeFormatter.setTimeZone(tz);
    }
    return (Date)dateTimeFormatter.parseObject(str);
  }
View Full Code Here

    }

    public Calendar getCalendar() {

        if (calendar == null) {
            TimeZone zone = TimeZone.getTimeZone(zoneString);

            calendar = new GregorianCalendar(zone);
        }

        return calendar;
View Full Code Here

                        "?" + biName + "(...) expects exactly 1 argument, but had "
                        + args.size() + ".");
                }
               
                TemplateModel tzArgTM = (TemplateModel) args.get(0);
                TimeZone tzArg;
                Object adaptedObj;
                if (tzArgTM instanceof AdapterTemplateModel
                        && (adaptedObj =
                                ((AdapterTemplateModel) tzArgTM)
                                .getAdaptedObject(TimeZone.class))
View Full Code Here

            if (name.equalsIgnoreCase("UTC")) {
                return UTC;
            }
            return TimeZone.getTimeZone(name);
        }
        TimeZone tz = TimeZone.getTimeZone(name);
        if (isGMTish(tz.getID())) {
            throw new UnrecognizedTimeZoneException(name);
        }
        return tz;
    }
View Full Code Here

        TestDatetimeSimple testA = new TestDatetimeSimple();
        String[]           zones = { "GMT-05:00" };

        try {
            for (int i = 0; i < zones.length; i++) {
                TimeZone timeZone = TimeZone.getTimeZone(zones[i]);

                TimeZone.setDefault(timeZone);
                testA.testSimple();
                testA.testValues();
            }
View Full Code Here

            Statement  stmt = conn.createStatement();

            stmt.executeUpdate("drop table testA if exists;");
            stmt.executeUpdate("create table testA(data timestamp);");

            TimeZone pst = TimeZone.getTimeZone("PST");
            Calendar cal = new GregorianCalendar(pst);

            cal.clear();
            cal.set(2005, 0, 1, 0, 0, 0);
View Full Code Here

TOP

Related Classes of java.util.TimeZone$DisplayNames

Copyright © 2018 www.massapicom. 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.