Jump to content

[SOLVED] Converting date format...


cgm225

Recommended Posts

strtotime() recognises some formats and not others, so playing safe

 

<?php
$date = '7.4.2007';
list ($m, $d, $y) = explode ('.', $date);           // swap $m and $d if using d.m.yyyy format
$rss_date = date('D, j M Y', strtotime("$y-$m-$d"));

echo $rss_date;
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.