- date_default_timezone_set: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
date_default_timezone_set('Asia/Chongqing');
$time1 = "2006-04-16 08:40:54";
$time2 = strtotime($time1);
echo $time2;
echo date('Y-m-d h:i:s',$time2)."\n";
echo date('Y',$time2)."\n";
echo (int)(date('m',$time2))."\n";
echo date('d',$time2)."\n";