Examples of TimeZone


Examples of java.util.TimeZone

    private void testTimeOperationsAcrossTimeZones() {
        if (!SysProperties.STORE_LOCAL_TIME) {
            return;
        }
        TimeZone defaultTimeZone = TimeZone.getDefault();
        ArrayList<TimeZone> distinct = TestDate.getDistinctTimeZones();
        Data d = Data.create(null, 10240);
        try {
            for (TimeZone tz : distinct) {
                TimeZone.setDefault(tz);
View Full Code Here

Examples of java.util.TimeZone

     * @return the list
     */
    public static ArrayList<TimeZone> getDistinctTimeZones() {
        ArrayList<TimeZone> distinct = New.arrayList();
        for (String id : TimeZone.getAvailableIDs()) {
            TimeZone t = TimeZone.getTimeZone(id);
            for (TimeZone d : distinct) {
                if (t.hasSameRules(d)) {
                    t = null;
                    break;
                }
            }
            if (t != null) {
View Full Code Here

Examples of java.util.TimeZone

  private static Logger logger = Logger.getLogger(SelectDateTimeHandler.class);
  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws RuntimeException, Exception {
    HttpSession session = request.getSession(true);
    UserObject user = (UserObject)session.getAttribute("userobject");
    UserPrefererences prefs = user.getUserPref();
    TimeZone tz = TimeZone.getTimeZone(prefs.getTimeZone());
    Locale locale = request.getLocale();
   
    String forward = ".view.calendar.datetime";
    // "dateTimeSelectForm" in mappings/calendar.xml
    DynaActionForm dateForm = (DynaActionForm) form;
View Full Code Here

Examples of java.util.TimeZone

  static StatementImpl createMockStatement(int cursorType) throws SQLException {
    StatementImpl statement = mock(StatementImpl.class);
    stub(statement.getDQP()).toReturn(mock(DQP.class));
    stub(statement.getResultSetType()).toReturn(cursorType);
    TimeZone tz = TimeZone.getTimeZone("GMT-06:00"); //$NON-NLS-1$
    TimeZone serverTz = TimeZone.getTimeZone("GMT-05:00"); //$NON-NLS-1$
    stub(statement.getDefaultCalendar()).toReturn(Calendar.getInstance(tz));
    stub(statement.getServerTimeZone()).toReturn(serverTz);
    return statement;
  }
View Full Code Here

Examples of java.util.TimeZone

    Collection v = cvdl.executeQuery();
    cvdl.clearParameters();
    cvdl.destroy();

    Iterator it = v.iterator();
    TimeZone tz = TimeZone.getTimeZone("EST");
    int i = 0;

    while (it.hasNext()) {
      i++;
      HashMap hm = (HashMap)it.next();
View Full Code Here

Examples of java.util.TimeZone

    Collection v = cvdl.executeQuery();
    cvdl.clearParameters();
    cvdl.destroy();

    Iterator it = v.iterator();
    TimeZone tz = TimeZone.getTimeZone("EST");
    int i = 0;

    while (it.hasNext()) {
      i++;
      HashMap hm = (HashMap)it.next();
View Full Code Here

Examples of java.util.TimeZone

    cvdl.clearParameters();
    cvdl.destroy();

    Iterator it = v.iterator();
    TimeZone tz = TimeZone.getTimeZone("EST");
    int i = 0;

    while (it.hasNext()) {
      i++;
      HashMap hm = (HashMap)it.next();
View Full Code Here

Examples of java.util.TimeZone

    }
   
    // ================= Function - MODIFYTIMEZONE ========================
   
    public static Object modifyTimeZone(Timestamp value, String originalTimezoneString, String targetTimezoneString) {
        TimeZone originalTimeZone = TimeZone.getTimeZone(originalTimezoneString);
        TimeZone dbmsTimeZone = TimeZone.getTimeZone(targetTimezoneString);

        // Check that the dbms time zone is really different than the local time zone
        if (originalTimeZone.equals(dbmsTimeZone)) {
            return value;
        }
View Full Code Here

Examples of java.util.TimeZone

       
        return TimestampWithTimezone.createTimestamp(value, originalTimeZone, cal);
    }

    public static Object modifyTimeZone(CommandContext context, Timestamp value, String targetTimezoneString) {
        TimeZone dbmsTimeZone = TimeZone.getTimeZone(targetTimezoneString);

        Calendar cal = Calendar.getInstance(dbmsTimeZone);
       
        return TimestampWithTimezone.createTimestamp(value, context.getServerTimeZone(), cal);
    }
View Full Code Here

Examples of java.util.TimeZone

        // this sql is for callable statement, don't check any more
        ArgCheck.isNotNull(sql, JDBCPlugin.Util.getString("MMPreparedStatement.Err_prep_sql")); //$NON-NLS-1$
        this.prepareSql = sql;

        TimeZone timezone = connection.getServerConnection().getLogonResult().getTimeZone();

        if (timezone != null && !timezone.hasSameRules(getDefaultCalendar().getTimeZone())) {
          this.serverCalendar = Calendar.getInstance(timezone);
        }       
    }
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.