js时间格式化
来源:互联网 发布:超级神基因优化液txt 编辑:程序博客网 时间:2024/05/16 09:23
js 时间格式化方法记录
var startTime = "";
var endTime = "";//返回yyyy-MM-dd格式时间
function formartdate(date) {
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
return year + "-" + (month < 10 ? ("0" + month) : month) + "-"
+ (day < 10 ? ("0" + day) : day);
}
// 初始化时间 一周前到现在
var initEndDate = new Date();
var initEndDateMiliSecond = initEndDate.getTime();
var initStartDate = new Date();
var initStartDateMiliSecond = initEndDateMiliSecond - 6 * 24 * 3600 * 1000;
initStartDate.setTime(initStartDateMiliSecond);
startTime = formartdate(initStartDate);
endTime = formartdate(initEndDate);
阅读全文
0 0
- 【js】js时间格式化
- js中格式化时间
- js时间日期格式化
- js 格式化时间
- js 格式化时间函数
- js格式化时间
- js 格式化时间
- js时间格式化
- js中格式化时间
- js 格式化时间
- js的时间格式化
- js 时间格式化
- js格式化时间
- js时间格式化
- js字符串格式化时间
- js 时间格式化
- 用js格式化时间
- js 时间格式化
- 海康NVR设备RTSP协议转RTMP协议
- Android-JobScheduler
- vector【Template】
- c#继承
- 异步加载
- js时间格式化
- 千金纵买相如赋,脉脉此情谁诉
- MVC,MVP 和 MVVM 的图示
- Eclipse添加阿里巴巴Java开发规约插件
- 2017年中国化工企业和中国石油企业百强已出炉:
- ST最终版本的标准外设库下载地址
- speex回音消除
- BZOJ 4569: [Scoi2016]萌萌哒
- Socket.io入门引渡