Today I found a handy class within in the Zend library to format date in whichever style you require:
$myDate = new Zend_Date(strtotime('2010-07-13'));
$myDate->toString("dd.MM.YYYY");
Perfect.. parse done
Note though the formatting of the string is a little different to that of the PHP date class ones, here are the Zend ones:
<?php
/**
* Returns a string representation of the object
* Supported format tokens are:
* G - era, y - year, Y - ISO year, M - month, w - week of year, D - day of year, d - day of month
* E - day of week, e - number of weekday (1-7), h - hour 1-12, H - hour 0-23, m - minute, s - second
* A - milliseconds of day, z - timezone, Z - timezone offset, S - fractional second, a - period of day
*
* Additionally format tokens but non ISO conform are:
* SS - day suffix, eee - php number of weekday(0-6), ddd - number of days per month
* l - Leap year, B - swatch internet time, I - daylight saving time, X - timezone offset in seconds
* r - RFC2822 format, U - unix timestamp
*
* Not supported ISO tokens are
* u - extended year, Q - quarter, q - quarter, L - stand alone month, W - week of month
* F - day of week of month, g - modified julian, c - stand alone weekday, k - hour 0-11, K - hour 1-24
* v - wall zone
*
* @param string $format OPTIONAL Rule for formatting output. If null the default date format is used
* @param string $type OPTIONAL Type for the format string which overrides the standard setting
* @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
* @return string
*/
?>
For instance to get:
Tue – 6 – 2010
the format string you will need is:
“EEE – M – YYYY”




