Package java.sql

Examples of java.sql.Date


                     * according to the type of this property.
                     */
                    if (Time.class.equals(getType())) {
                        newValue = new Time(millis);
                    } else if (Date.class.equals(getType())) {
                        newValue = new Date(millis);
                    } else if (Timestamp.class.equals(getType())) {
                        newValue = new Timestamp(millis);
                    }
                }
            }
View Full Code Here


    private InlineDateField createInlineDateField(String caption, String width,
            Locale locale) {
        InlineDateField pd = new InlineDateField(caption + "("
                + locale.toString() + ")");
        pd.setWidth(width);
        pd.setValue(new Date(12312312313L));
        pd.setLocale(locale);
        pd.setResolution(Resolution.YEAR);

        return pd;
    }
View Full Code Here

    private PopupDateField createPopupDateField(String caption, String width,
            Locale locale) {
        PopupDateField pd = new PopupDateField(caption + "("
                + locale.toString() + ")");
        pd.setWidth(width);
        pd.setValue(new Date(12312312313L));
        pd.setLocale(locale);
        pd.setResolution(Resolution.YEAR);

        return pd;
    }
View Full Code Here

    public void setNewsDate () {
        setProperty("newsDate", Long.toString(Calendar.getInstance().getTime().getTime()));
    }

    public String getNewsDate () {
        return getProperty("newsDate", Long.toString(new Date(0).getTime()));
    }
View Full Code Here

    clearTime();
  }

  // implement ZonelessDatetime
  public Object toJdbcObject() {
    return new Date(getJdbcDate(DateTimeUtil.DEFAULT_ZONE));
  }
View Full Code Here

   * {@link java.sql.Date#toString() toString()} method of that class.
   *
   * @return the formatted date string
   */
  public String toString() {
    Date jdbcDate = getTempDate(getJdbcDate(DateTimeUtil.DEFAULT_ZONE));
    return jdbcDate.toString();
  }
View Full Code Here

   * @param format format string, as required by {@link SimpleDateFormat}
   * @return the formatted date string
   */
  public String toString(String format) {
    DateFormat formatter = getFormatter(format);
    Date jdbcDate = getTempDate(getTime());
    return formatter.format(jdbcDate);
  }
View Full Code Here

  /**
   * Gets a temporary Date object. The same object is returned every time.
   */
  protected Date getTempDate(long value) {
    if (tempDate == null) {
      tempDate = new Date(value);
    } else {
      tempDate.setTime(value);
    }
    return tempDate;
  }
View Full Code Here

      if (v == null) {
        return null;
      }
      long time = v.getTime();
      int offset = TimeZone.getDefault().getOffset(time);
      return new Date(time + offset);
    }
View Full Code Here

        return null;
      }
      if (calendar != null) {
        long v = date.getTime();
        v -= calendar.getTimeZone().getOffset(v);
        date = new Date(v);
      }
      return date;
    }
View Full Code Here

TOP

Related Classes of java.sql.Date

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.