PHP date reformat function
Use DateTime::createFromFormat method to convert datetime strings to DateTime object:

$date1 = DateTime::createFromFormat('Y-m-d H:i', '2013-09-30 14:20');
$date2 = DateTime::createFromFormat('d/m/Y Hi', '30/09/2013 1420');


Now you can just format your output:

echo 'unix  : ' . $date1-&gt;format('U') . "\n";
echo 'human : ' . $date1-&gt;format('Y-m-d H:i:s') . "\n";
echo 'dst   : ' . $date1-&gt;format('I') . "\n";


And you don't need to adjust timestamp for +1 hour if in DST, DateTime can handle leap years and DST correctly. Set timezone when you create DateTime object, or change timezone after.