public class Strftime extends Object
Modifier and Type | Field and Description |
---|---|
protected SimpleDateFormat |
simpleDateFormat |
protected static Properties |
translate |
Constructor and Description |
---|
Strftime(String origFormat,
Locale locale)
Create an instance of this date formatting class
|
Modifier and Type | Method and Description |
---|---|
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.
|
String |
format(Date date)
Format the date according to the strftime-style string given in the constructor.
|
TimeZone |
getTimeZone()
Get the timezone used for formatting conversions
|
protected String |
quote(String str,
boolean insideQuotes) |
void |
setTimeZone(TimeZone timeZone)
Change the timezone used to format dates
|
protected boolean |
translateCommand(StringBuilder buf,
String pattern,
int index,
boolean oldInside)
Try to get the Java Date/Time formatting associated with
the C standard provided.
|
protected static final Properties translate
protected final SimpleDateFormat simpleDateFormat
public String format(Date date)
date
- the date to formatpublic TimeZone getTimeZone()
public void setTimeZone(TimeZone timeZone)
timeZone
- The new time zoneDateFormat.setTimeZone(java.util.TimeZone)
protected String convertDateFormat(String pattern)
pattern
- The pattern to searchprotected boolean translateCommand(StringBuilder buf, String pattern, int index, boolean oldInside)
buf
- The bufferpattern
- The date/time patternindex
- The char indexoldInside
- Flag valueCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.