Jump to content

date


brown2005

Recommended Posts

This is the exact same thing, but you have some flexibility in using the date function:

<?php
$date = "2007-04-05";
$temp = explode("-",$date);
echo date("d-m-Y", mktime(0, 0, 0, $temp[1], $temp[2], $temp[0]));
?>

 

What was previously posted is also legitimate and might be easier, but this will help you out if you ever want a different format.

Link to comment
https://forums.phpfreaks.com/topic/41175-date/#findComment-199497
Share on other sites

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.