Convert hasil time() pada php ke tahun, bulan, jam, menit, detik
$time = time() // you have 1299446702 in time
$year = $time/31556926 % 12; // to get year
$week = $time / 604800 % 52; // to get weeks
$hour = $time / 3600 % 24; // to get hours
$minute = $time / 60 % 60; // to get minutes
$second = $time % 60; // to get seconds
example :
echo date('m/d/Y', 1299446702);
$year = $time/31556926 % 12; // to get year
$week = $time / 604800 % 52; // to get weeks
$hour = $time / 3600 % 24; // to get hours
$minute = $time / 60 % 60; // to get minutes
$second = $time % 60; // to get seconds
example :
echo date('m/d/Y', 1299446702);
thanks gan infonya, anel butuh artikel ini...
ReplyDeleteya sama2...
Delete