org.as2lib.core.BasicClass +--org.as2lib.util.DateFormatter
DateFormatter
formats a given date with a specified pattern.
Use the declared constants as placeholders for specific parts of the date-time.
All characters from 'A' to 'Z' and from 'a' to 'z' are reserved, although not
all of these characters are interpreted right now. If you want to include plain
text in the pattern put it into quotes (') to avoid interpretation. If you want
a quote in the formatted date-time, put two quotes directly after one another.
For example: "hh 'o''clock'"
.
Example:
var formatter:DateFormatter = new DateFormatter("dd.mm.yyyy HH:nn:ss S");
trace(formatter.format(new Date(2005, 2, 29, 18, 14, 3, 58)));
Output:
29.03.2005 18:14:03 58
static public DEFAULT_DATE_FORMAT:String
static public YEAR:String
static public MONTH_AS_NUMBER:String
static public MONTH_AS_TEXT:String
static public DAY_AS_NUMBER:String
static public DAY_AS_TEXT:String
static public HOUR_IN_AM_PM:String
static public HOUR_IN_DAY:String
static public MINUTE:String
static public SECOND:String
static public MILLISECOND:String
static public QUOTE:String
static public JANUARY:String
static public FEBRUARY:String
static public MARCH:String
static public APRIL:String
static public MAY:String
static public JUNE:String
static public JULY:String
static public AUGUST:String
static public SEPTEMBER:String
static public OCTOBER:String
static public NOVEMBER:String
static public DECEMBER:String
static public MONDAY:String
static public TUESDAY:String
static public WEDNESDAY:String
static public THURSDAY:String
static public FRIDAY:String
static public SATURDAY:String
static public SUNDAY:String
public function format(date:Date):String
Formats the passed-in date
with the specified date format pattern into a
date-time string and returns the resulting string.
If the passed-in date
is null
or undefined
, the current
date-time will be used instead.
date | the date-time value to format into a date-time string |
the formatted date-time string