Class pv.Format.date
Extends
pv.Format.
The format string is in the same format expected by the
strftime function in C. The following conversion specifications are
supported:
- %a - abbreviated weekday name.
- %A - full weekday name.
- %b - abbreviated month names.
- %B - full month names.
- %c - locale's appropriate date and time.
- %C - century number.
- %d - day of month [01,31] (zero padded).
- %D - same as %m/%d/%y.
- %e - day of month [ 1,31] (space padded).
- %h - same as %b.
- %H - hour (24-hour clock) [00,23] (zero padded).
- %I - hour (12-hour clock) [01,12] (zero padded).
- %m - month number [01,12] (zero padded).
- %M - minute [0,59] (zero padded).
- %n - newline character.
- %p - locale's equivalent of a.m. or p.m.
- %r - same as %I:%M:%S %p.
- %R - same as %H:%M.
- %S - second [00,61] (zero padded).
- %t - tab character.
- %T - same as %H:%M:%S.
- %x - same as %m/%d/%y.
- %X - same as %I:%M:%S %p.
- %y - year with century [00,99] (zero padded).
- %Y - year including century.
- %% - %.
- %j - day number [1,366].
- %u - weekday number [1,7].
- %U - week number [00,53].
- %V - week number [01,53].
- %w - weekday number [0,6].
- %W - week number [00,53].
- %Z - timezone name or abbreviation.
- %a - day of week, either abbreviated or full name.
- %A - same as %a.
- %c - locale's appropriate date and time.
- %C - century number.
- %D - same as %m/%d/%y.
- %I - hour (12-hour clock) [1,12].
- %n - any white space.
- %p - locale's equivalent of a.m. or p.m.
- %r - same as %I:%M:%S %p.
- %R - same as %H:%M.
- %t - same as %n.
- %T - same as %H:%M:%S.
- %x - locale's equivalent to %m/%d/%y.
- %X - locale's equivalent to %I:%M:%S %p.
Defined in: DateFormat.js.
Constructor Attributes | Constructor Name and Description |
---|---|
pv.Format.date(pattern)
Constructs a new date format with the specified string pattern.
|
Method Attributes | Method Name and Description |
---|---|
format(date)
Converts a date to a string using the associated formatting pattern.
|
|
parse(s)
Parses a date from a string using the associated formatting pattern.
|
Class Detail
pv.Format.date(pattern)
Constructs a new date format with the specified string pattern.
- Parameters:
- {string} pattern
- the format pattern.
Method Detail
{string}
format(date)
Converts a date to a string using the associated formatting pattern.
- Parameters:
- {Date} date
- a date to format.
- Returns:
- {string} the formatted date as a string.
{Date}
parse(s)
Parses a date from a string using the associated formatting pattern.
- Parameters:
- {string} s
- the string to parse as a date.
- Returns:
- {Date} the parsed date.