[ create a new paste ] login | about

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

PHP, pasted on Jan 30:
1
2
3
4
5
6
7
8
<?php

$date = '30/01/2011, 4:57 pm';
$to_mysql_date = date('Y-m-d h:i:s', strtotime(str_replace('/', '-', $date)));
echo $to_mysql_date;


?>


Output:
1
2011-01-30 04:57:00


Create a new paste based on this one


Comments: