lzth.net
当前位置:首页 >> noDEjs DAtEtimE >>

noDEjs DAtEtimE

function DateTimeFormatter(value) { if (value == undefined) { return ""; } /*json转js时间格式*/ value = value.substr(1, value.length - 2); var obj = eval('(' + "{Date: new " + value + "}" + ')'); var dateValue = obj["Date"]; if...

1、比较常用的方法,但繁琐,参考如下: 主要使用Date的构造方法:Date(int year , int month , int day) var str1 = "2009-8-9"; var arr1 = str1.split("-"); var date1 = new Date(arr1[0],parseInt(arr1[1])-1,arr1[2]); var str2 = "2009-8...

function showTime() { var now = new Date(); var nowTime = now.toLocaleString(); var date = nowTime.substring(0,10);//截取日期 var time = nowTime.substring(10,20); //截取时间 var week = now.getDay(); //星期 var hour = now.getHou...

网站首页 | 网站地图
All rights reserved Powered by www.lzth.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com