Page 1 of 1

Get locale date format?

Posted: Tue Jul 19, 2011 12:42 pm
by RussellEngland
Going round in circles with this. If I use setlocale(LC_ALL,'en_GB'), how do I get the date format as a string?

Code: Select all

setlocale(LC_ALL, 'en_GB');

$format=???? // dd/mm/yy

$time="29/12/65"; 

$isodate = date_create_from_format( $format,  $time);

$isodate = date_format( $isodate , ISO8601 );

echo $isodate

Re: Get locale date format?

Posted: Tue Jul 19, 2011 1:31 pm
by AbraCadaver
Need 5.3 unless there is another way: datefmt_get_pattern()