本文主要介绍jquery时间戳更新过程的详细说明,并通过示例代码进行详细介绍。对大家的学习或工作都有一定的参考学习价值,有需要的朋友可以参考一下
搜索后发现这个时间戳到时间的代码非常好用,附上了实用的代码
结果如下
代码如下
/* * *时间戳到日期* @ paramtimestamp * @返回{ * } */函数时间戳(timestamp){ vardate=new date(timestamp * 1000);//如果时间戳是10位,则需要* 1000;如果时间戳是13位,则不需要乘以1000Y=date . getfullyear()'-';m=(date . getmonth)(1 10?0 '(date . getmonth()1): date . getmonth()1)'-';d=date . GetDate()' ';h=date . gethours()' : ';m=(date . getminutes)(10?0 '(date . getminutes()): date . getminutes())' : ';s=(date . getseconds())10?0 '(date . getseconds()): date . getseconds());返回Y M D h M s;}
以上就是本文的全部内容。希望对大家的学习有帮助,支持我们。