TSimpleDateFormatter class.
Formats and parses dates using the SimpleDateFormat pattern. This pattern is compatible with the I18N and java's SimpleDateFormatter.
- Pattern | Description
- ----------------------------------------------------
- d | Day of month 1 to 31, no padding
- dd | Day of monath 01 to 31, zero leading
- M | Month digit 1 to 12, no padding
- MM | Month digit 01 to 12, zero leading
- yy | 2 year digit, e.g., 96, 05
- yyyy | 4 year digit, e.g., 2005
- ----------------------------------------------------
Usage example, to format a date
- $formatter = new TSimpleDateFormatter("dd/MM/yyy");
- echo $formatter->format(time());
To parse the date string into a date timestamp.
- $formatter = new TSimpleDateFormatter("d-M-yyy");
- echo $formatter->parse("24-6-2005");
Located in /Util/TSimpleDateFormatter.php (line 47)
Constructor, create a new date time formatter.
Format the date according to the pattern.
Parse the string according to the pattern.
Documentation generated on Mon, 21 Apr 2008 11:36:11 -0400 by phpDocumentor 1.3.0RC4