时间戳的计算
mysql:
select unix_timestamp();
select unix_timestamp('1986-10-05 10:43:23');
select from_unixtime(unix_timestamp());
select from_unixtime(528864203,'%Y年%m月%d日 %H时%i分%s秒');
php:
echo time();
echo strtotime('1986-10-05 10:43:23');
echo date('Y-m-d H:i:s',528864203);
javascript:
timestamp = Math.round(new Date().getTime()/1000) = 秒;
timestamp = Math.round(new Date('1986/10/05 10:43:23').getTime()/1000) = 秒;
mysql:
select unix_timestamp();
select unix_timestamp('1986-10-05 10:43:23');
select from_unixtime(unix_timestamp());
select from_unixtime(528864203,'%Y年%m月%d日 %H时%i分%s秒');
php:
echo time();
echo strtotime('1986-10-05 10:43:23');
echo date('Y-m-d H:i:s',528864203);
javascript:
timestamp = Math.round(new Date().getTime()/1000) = 秒;
timestamp = Math.round(new Date('1986/10/05 10:43:23').getTime()/1000) = 秒;