/** * Returns a formated date and time String from a Date value, * the formatting based on the provided option and the locale * based on this instance.<p> * * @param date the Date object to format as String * @param format the format to use, see {@link CmsMessages} for possible values * @return the formatted date and time */ public String getDateTime(Date date, int format) { return CmsDateUtil.getDateTime(date, format, m_locale); }
/** * Returns a formated date String from a Date value, * the formatting based on the provided option and the locale * based on this instance.<p> * * @param date the Date object to format as String * @param format the format to use, see {@link CmsMessages} for possible values * @return the formatted date */ public String getDate(Date date, int format) { return CmsDateUtil.getDate(date, format, m_locale); }
/** * Returns a string-representation for this object. <p> * * This is used to create the sync list entries in the server FS * * @return string-representation for this object. */ @Override public String toString() { String output = m_resName + ":" + m_transResName + ":" + m_modifiedVfs + ":" + m_modifiedFs; output += ":VFS=" + CmsDateUtil.getDateTimeShort(m_modifiedVfs); output += ":FS=" + CmsDateUtil.getDateTimeShort(m_modifiedFs); return output; }
Date lastModDate = sResult.getDateLastModified(); String formattedDate = lastModDate != null ? CmsDateUtil.getDateTime(lastModDate, DateFormat.MEDIUM, wpLocale) : ""; bean.setDateLastModified(formattedDate); bean.addAdditionalInfo( Messages.get().getBundle(getWorkplaceLocale()).key(Messages.GUI_RESULT_LABEL_DATE_CHANGED_0), CmsDateUtil.getDate(lastModDate, DateFormat.SHORT, getWorkplaceLocale())); bean.addAdditionalInfo( Messages.get().getBundle(getWorkplaceLocale()).key(Messages.GUI_RESULT_LABEL_DATE_EXPIRED_0), CmsDateUtil.getDate(sResult.getDateExpired(), DateFormat.SHORT, getWorkplaceLocale()));
/** * Method overload from the standard HttpServletRequest API.<p> * * @see javax.servlet.http.HttpServletResponse#addDateHeader(java.lang.String, long) */ @Override public void addDateHeader(String name, long date) { addHeader(name, CmsDateUtil.getHeaderDate(date)); }
/** * Convert a given time stamp from a String format to a long value.<p> * * The time stamp is either the string representation of a long value (old export format) * or a user-readable string format.<p> * * @param timestamp time stamp to convert * * @return long value of the time stamp */ protected long convertTimestamp(String timestamp) { long value = 0; // try to parse the time stamp string // if it successes, its an old style long value try { value = Long.parseLong(timestamp); } catch (NumberFormatException e) { // the time stamp was in in a user-readable string format, create the long value form it try { value = CmsDateUtil.parseHeaderDate(timestamp); } catch (ParseException pe) { value = System.currentTimeMillis(); } } return value; }
} else { result.append(m_messages.key(Messages.GUI_UNCHANGED_SINCE_1, new Object[] {new Integer( CmsDateUtil.getDaysPassedSince(notificationCause.getDate()))})); result.append("</div></td>"); appendConfirmLink(result, notificationCause);
time = System.currentTimeMillis() + (cookie.getMaxAge() * 1000L); header.append(CmsDateUtil.getOldCookieDate(time)); } else {
/** * Method overload from the standard HttpServletRequest API.<p> * * @see javax.servlet.http.HttpServletResponse#addDateHeader(java.lang.String, long) */ @Override public void addDateHeader(String name, long date) { addHeader(name, CmsDateUtil.getHeaderDate(date)); }
/** * Convert a given timestamp from a String format to a long value.<p> * * The timestamp is either the string representation of a long value (old export format) * or a user-readable string format. * * @param timestamp timestamp to convert * @return long value of the timestamp */ private long convertTimestamp(String timestamp) { long value = 0; // try to parse the timestamp string // if it successes, its an old style long value try { value = Long.parseLong(timestamp); } catch (NumberFormatException e) { // the timestamp was in in a user-readable string format, create the long value form it try { value = CmsDateUtil.parseHeaderDate(timestamp); } catch (ParseException pe) { value = System.currentTimeMillis(); } } return value; }
result.append(m_messages.key( Messages.GUI_UNCHANGED_SINCE_1, new Object[] {new Integer(CmsDateUtil.getDaysPassedSince(notificationCause.getDate()))})); result.append("</div></td>"); appendConfirmLink(result, notificationCause);
time = System.currentTimeMillis() + (cookie.getMaxAge() * 1000L); header.append(CmsDateUtil.getOldCookieDate(time)); } else {
/** * Returns a formated date and time String from a Date value, * the format being {@link DateFormat#SHORT} and the locale * based on this instance.<p> * * @param date the Date object to format as String * @return the formatted date and time */ public String getDateTime(Date date) { return CmsDateUtil.getDateTime(date, DateFormat.SHORT, m_locale); }
/** * Method overload from the standard HttpServletRequest API.<p> * * @see javax.servlet.http.HttpServletResponse#setDateHeader(java.lang.String, long) */ @Override public void setDateHeader(String name, long date) { setHeader(name, CmsDateUtil.getHeaderDate(date)); }
/** * Returns a formated date String from a Date value, * the format being {@link DateFormat#SHORT} and the locale * based on this instance.<p> * * @param date the Date object to format as String * @return the formatted date */ public String getDate(Date date) { return CmsDateUtil.getDate(date, DateFormat.SHORT, m_locale); }
/** * Convert a given time stamp from a String format to a long value.<p> * * The time stamp is either the string representation of a long value (old export format) * or a user-readable string format. * * @param timestamp time stamp to convert * * @return long value of the time stamp */ protected long convertTimestamp(String timestamp) { long value = 0; // try to parse the time stamp string // if it successes, its an old style long value try { value = Long.parseLong(timestamp); } catch (NumberFormatException e) { // the time stamp was in in a user-readable string format, create the long value form it try { value = CmsDateUtil.parseHeaderDate(timestamp); } catch (ParseException pe) { value = System.currentTimeMillis(); } } return value; }
/** * Returns a string-representation for this object. <p> * * This is used to create the sync list entries in the server FS * * @return string-representation for this object. */ @Override public String toString() { String output = m_resName + ":" + m_transResName + ":" + m_modifiedVfs + ":" + m_modifiedFs; output += ":VFS=" + CmsDateUtil.getDateTimeShort(m_modifiedVfs); output += ":FS=" + CmsDateUtil.getDateTimeShort(m_modifiedFs); return output; }
/** * Returns a formated date and time String from a Date value, * the formatting based on the provided option and the locale * based on this instance.<p> * * @param date the Date object to format as String * @param format the format to use, see {@link CmsMessages} for possible values * @return the formatted date and time */ public String getDateTime(Date date, int format) { return CmsDateUtil.getDateTime(date, format, m_locale); }
/** * Method overload from the standard HttpServletRequest API.<p> * * @see javax.servlet.http.HttpServletResponse#setDateHeader(java.lang.String, long) */ @Override public void setDateHeader(String name, long date) { setHeader(name, CmsDateUtil.getHeaderDate(date)); }
/** * Returns a formated date String from a Date value, * the formatting based on the provided option and the locale * based on this instance.<p> * * @param date the Date object to format as String * @param format the format to use, see {@link CmsMessages} for possible values * @return the formatted date */ public String getDate(Date date, int format) { return CmsDateUtil.getDate(date, format, m_locale); }