|
Jameo Core Library
|
Returns the date in a formatted string. The following placeholders are available: y : year : 2015; 15 M : month : July; Jul; 07; 7 w: calendar week : 42 W: week of the month: 1 D: day of the year: 142 d: day of the month: 24 F: weekday of the month: 2 E: weekday: Tuesday; Tu, T a: AM/PM marker: AM; H: hour (0-23) K: hour (0-11) h: hour (1-12) k: hour (1-24) m: minute of the hour s: second of the minute S: millisecond z: time zone. More...
Public Member Functions | |
| DateFormatter (const String &pattern) | |
| Constructor. | |
| ~DateFormatter () | |
| String | format (const Date &date) const |
Public Member Functions inherited from jm::Object | |
| Object () noexcept | |
| Constructor. | |
| virtual | ~Object () noexcept |
| Destructor. | |
| void | release () noexcept |
| Decreases the reference counter and releases the object immediately when the reference counter becomes 0. | |
| Object * | retain () noexcept |
| Increases the reference counter of this object by 1. | |
| Object * | autorelease () noexcept |
| Same function as release(), but releases the object with a delay if the reference counter is 0. AutoreleasePool::drain() must be called in the to release the object. | |
| int32 | referenceCount () const noexcept |
| Returns the value of the reference counter. | |
| virtual bool | equals (const Object *other) const |
| Comparison of objects. | |
| virtual String | displayName () const |
| Returns the display name of the object intended to present to a user. | |
| virtual void | printDiffInfo (DiffOperation operation, Object *other) const |
| Output method for outputting the diff results for the diff algorithm. | |
| void | setHighBit (bool status) noexcept |
| bool | highBit () const noexcept |
Static Public Member Functions | |
| static String | format (const String &format, const Date &date) |
Returns the date in a formatted string. The following placeholders are available: y : year : 2015; 15 M : month : July; Jul; 07; 7 w: calendar week : 42 W: week of the month: 1 D: day of the year: 142 d: day of the month: 24 F: weekday of the month: 2 E: weekday: Tuesday; Tu, T a: AM/PM marker: AM; H: hour (0-23) K: hour (0-11) h: hour (1-12) k: hour (1-24) m: minute of the hour s: second of the minute S: millisecond z: time zone.
Additions: text: the long form is used for 4 or more letters, otherwise a short one is used year: if pattern = yy, then ?Year: If pattern = yy, then it is displayed as 15, otherwise as 2015
' ' can be used to mark the text.
|
explicit |
Constructor.
| pattern | The pattern for the date format |
| jm::DateFormatter::~DateFormatter | ( | ) |