首页 > Web开发 > 详细

js日期转换工具

时间:2018-12-13 13:37:29      阅读:303      评论:0      收藏:0      [点我收藏+]
var dq = new Date();//定义当前时间
var sDueDate = formatDate(dq);/调用日期转换方法 传入当前时间
//进行日期转换
function formatDate(now) { debugger
var year = now.getFullYear(); var month = now.getMonth() + 1; var date = now.getDate()-10; var hour = now.getHours(); var minute = now.getMinutes(); var second = now.getSeconds(); return year + "-" + month + "-" + date; }

 

js日期转换工具

原文:https://www.cnblogs.com/Ai-Hen-Jiao-zhi/p/10113470.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!