js时间戳转时间格式
function data_string(str) { var d = eval('new ' + str.substr(1, str.length - 2)); console.log(d); return formatDate(d); } function formatDate(now) { var year = now.getFullYear(); var month = now.getMonth() + 1; var date = now.getDate(); var hour = now.getHours(); var minute = now.getMinutes(); var second = now.getSeconds(); return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second; }
调用data_string方法
本文来自博客园,作者:沉迷编程的程序员,转载请注明原文链接:https://www.cnblogs.com/codeDevotee/p/8405846.html
欢迎各位找我代写程序,python、c#、web等都可以,加我请注明博客园微信:A15919195482