php方法 time();獲取現在時(shí)間 得到 10位數
js new Date();獲取現在時(shí)間 Date.getTime() ; 得到13位數字
new Date('13位的數字');得到現在時(shí)間的Date對象;
php傳到j(luò )s的時(shí)間戳 要*1000可以正確解讀;
var time = new Date(parseInt(phptime)*1000) //php轉換js
var time = Date.parse(new Date())/1000 //js轉換php
發(fā)表評論