/** * Create an instance of this date formatting class * * @param origFormat the strftime-style formatting string * @param locale the locale to use for locale-specific conversions */ public Strftime( String origFormat, Locale locale ) { String convertedFormat = convertDateFormat( origFormat ); simpleDateFormat = new SimpleDateFormat( convertedFormat, locale ); }
protected String formatDate(Date date, TimeZone timeZone) { String retVal; if (timeZone != null) { //we temporarily change strftime. Since SSIMediator is inherently // single-threaded, this //isn't a problem TimeZone oldTimeZone = strftime.getTimeZone(); strftime.setTimeZone(timeZone); retVal = strftime.format(date); strftime.setTimeZone(oldTimeZone); } else { retVal = strftime.format(date); } return retVal; }
newInside = translateCommand( buf, pattern, index + 1, oldInside ); } else { buf.append( quote("%" + firstChar, oldInside ) ); buf.append( quote( "%" + firstChar, oldInside ) ); } else {
mark = false; } else { inside = translateCommand( buf, pattern, i, inside );
public void setConfigTimeFmt(String configTimeFmt, boolean fromConstructor) { this.configTimeFmt = configTimeFmt; this.strftime = new Strftime(configTimeFmt, 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); }
newInside = translateCommand( buf, pattern, index + 1, oldInside ); } else { buf.append( quote("%" + firstChar, oldInside ) ); buf.append( quote( "%" + firstChar, oldInside ) ); } else {
mark = false; } else { inside = translateCommand( buf, pattern, i, inside );
public void setConfigTimeFmt(String configTimeFmt, boolean fromConstructor) { this.configTimeFmt = configTimeFmt; this.strftime = new Strftime(configTimeFmt, 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, TimeZone timeZone) { String retVal; if (timeZone != null) { //we temporarily change strftime. Since SSIMediator is inherently // single-threaded, this //isn't a problem TimeZone oldTimeZone = strftime.getTimeZone(); strftime.setTimeZone(timeZone); retVal = strftime.format(date); strftime.setTimeZone(oldTimeZone); } else { retVal = strftime.format(date); } return retVal; }
newInside = translateCommand( buf, pattern, index + 1, oldInside ); } else { buf.append( quote("%" + firstChar, oldInside ) ); buf.append( quote( "%" + firstChar, oldInside ) ); } else {
/** * Create an instance of this date formatting class * * @param origFormat the strftime-style formatting string * @param locale the locale to use for locale-specific conversions */ public Strftime( String origFormat, Locale locale ) { String convertedFormat = convertDateFormat( origFormat ); simpleDateFormat = new SimpleDateFormat( convertedFormat, locale ); }
mark = false; } else { inside = translateCommand( buf, pattern, i, inside );
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, TimeZone timeZone) { String retVal; if (timeZone != null) { //we temporarily change strftime. Since SSIMediator is inherently // single-threaded, this //isn't a problem TimeZone oldTimeZone = strftime.getTimeZone(); strftime.setTimeZone(timeZone); retVal = strftime.format(date); strftime.setTimeZone(oldTimeZone); } else { retVal = strftime.format(date); } return retVal; }
newInside = translateCommand( buf, pattern, index + 1, oldInside ); } else { buf.append( quote("%" + firstChar, oldInside ) ); buf.append( quote( "%" + firstChar, oldInside ) ); } else {
/** * Create an instance of this date formatting class * * @param origFormat the strftime-style formatting string * @param locale the locale to use for locale-specific conversions */ public Strftime( String origFormat, Locale locale ) { String convertedFormat = convertDateFormat( origFormat ); simpleDateFormat = new SimpleDateFormat( convertedFormat, locale ); }
mark = false; } else { inside = translateCommand( buf, pattern, i, inside );