/** * Add the specified date header to the specified value. * * @param name Name of the header to set * @param value Date value to be set */ @Override public void addDateHeader(String name, long value) { if (name == null || name.length() == 0) { return; } if (isCommitted()) { return; } // Ignore any call from an included servlet if (included) { return; } if (format == null) { format = new SimpleDateFormat(DateTool.HTTP_RESPONSE_DATE_HEADER, Locale.US); format.setTimeZone(TimeZone.getTimeZone("GMT")); } addHeader(name, FastHttpDateFormat.formatDate(value, format)); }
/** * Set the specified date header to the specified value. * * @param name Name of the header to set * @param value Date value to be set */ @Override public void setDateHeader(String name, long value) { if (name == null || name.length() == 0) { return; } if (isCommitted()) { return; } // Ignore any call from an included servlet if (included) { return; } if (format == null) { format = new SimpleDateFormat(DateTool.HTTP_RESPONSE_DATE_HEADER, Locale.US); format.setTimeZone(TimeZone.getTimeZone("GMT")); } setHeader(name, FastHttpDateFormat.formatDate(value, format)); }
/** * Add the specified date header to the specified value. * * @param name Name of the header to set * @param value Date value to be set */ @Override public void addDateHeader(String name, long value) { if (name == null || name.length() == 0) { return; } if (isCommitted()) return; // Ignore any call from an included servlet if (included) { return; } if (format == null) { format = new SimpleDateFormat(DateTool.HTTP_RESPONSE_DATE_HEADER, Locale.US); format.setTimeZone(TimeZone.getTimeZone("GMT")); } addHeader(name, FastHttpDateFormat.formatDate(value, format)); }
/** * Set the specified date header to the specified value. * * @param name Name of the header to set * @param value Date value to be set */ @Override public void setDateHeader(String name, long value) { if (name == null || name.length() == 0) { return; } if (isCommitted()) return; // Ignore any call from an included servlet if (included) { return; } if (format == null) { format = new SimpleDateFormat(DateTool.HTTP_RESPONSE_DATE_HEADER, Locale.US); format.setTimeZone(TimeZone.getTimeZone("GMT")); } setHeader(name, FastHttpDateFormat.formatDate(value, format)); }
public void setConfigTimeFmt(String configTimeFmt, boolean fromConstructor) { this.configTimeFmt = configTimeFmt; //What's the story here with DateTool.LOCALE_US?? Why?? this.strftime = new Strftime(configTimeFmt, DateTool.LOCALE_US); //Variables like DATE_LOCAL, DATE_GMT, and LAST_MODIFIED need to be // updated when //the timefmt changes. This is what Apache SSI does. setDateVariables(fromConstructor); }
public void setConfigTimeFmt( String configTimeFmt, boolean fromConstructor ) { this.configTimeFmt = configTimeFmt; //What's the story here with DateTool.LOCALE_US?? Why?? this.strftime = new Strftime( configTimeFmt, DateTool.LOCALE_US ); //Variables like DATE_LOCAL, DATE_GMT, and LAST_MODIFIED need to be updated when //the timefmt changes. This is what Apache SSI does. setDateVariables( fromConstructor ); }
protected String formatDate(Date date, String configTimeFmt) { Strftime strftime = new Strftime(configTimeFmt, DateTool.LOCALE_US); return strftime.format(date); }
protected String formatDate( Date date, String configTimeFmt ) { Strftime strftime = new Strftime( configTimeFmt, DateTool.LOCALE_US ); return strftime.format( date ); }