Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » util » [javadoc | source]
org.apache.catalina.util
public class: Strftime [javadoc | source]
java.lang.Object
   org.apache.catalina.util.Strftime
Converts dates to strings using the same format specifiers as strftime Note: This does not mimic strftime perfectly. Certain strftime commands, are not supported, and will convert as if they were literals. Certain complicated commands, like those dealing with the week of the year probably don't have exactly the same behavior as strftime. These limitations are due to use SimpleDateTime. If the conversion was done manually, all these limitations could be eliminated. The interface looks like a subset of DateFormat. Maybe someday someone will make this class extend DateFormat.
Field Summary
protected static  Properties translate     
protected  SimpleDateFormat simpleDateFormat     
Constructor:
 public Strftime(String origFormat) 
    Create an instance of this date formatting class
 public Strftime(String origFormat,
    Locale locale) 
    Create an instance of this date formatting class
    Parameters:
    origFormat - the strftime-style formatting string
    locale - the locale to use for locale-specific conversions
Method from org.apache.catalina.util.Strftime Summary:
convertDateFormat,   format,   getTimeZone,   quote,   setTimeZone,   translateCommand
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.util.Strftime Detail:
 protected String convertDateFormat(String pattern) 
    Search the provided pattern and get the C standard Date/Time formatting rules and convert them to the Java equivalent.
 public String format(Date date) 
    Format the date according to the strftime-style string given in the constructor.
 public TimeZone getTimeZone() 
    Get the timezone used for formatting conversions
 protected String quote(String str,
    boolean insideQuotes) 
 public  void setTimeZone(TimeZone timeZone) 
    Change the timezone used to format dates
 protected boolean translateCommand(StringBuffer buf,
    String pattern,
    int index,
    boolean oldInside) 
    Try to get the Java Date/Time formatting associated with the C standard provided.