[ create a new paste ] login | about

Link: http://codepad.org/JnVpDFb7    [ raw code | output | fork ]

PHP, pasted on Nov 7:
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

$date = "1990-05-07"; // Y-m-d
$date = date("d/m/Y", strtotime($date));
echo $date; // output: 07/05/1990

echo "\n";

$date = "1990-05-07"; // Y-m-d
$date = date("Y-m-d", strtotime($date));
echo $date; // output: 1990-05-07

?>


Output:
1
2
07/05/1990
1990-05-07


Create a new paste based on this one


Comments: