标签:minutes ted cti 时分秒 ret var str 拼接 turn
//拼接年月日时分秒 格式为:2015-03-02 13:25:02
function getFllTime(){
var date = new Date();
//月份
var month = date.getMonth()>=0 && date.getMonth()<=9?"0"+(date.getMonth()+1):(date.getMonth()+1);
//日期
var day = date.getDate()>=0 && date.getDate()<=9 ? "0"+date.getDate():date.getDate();
//时
var hours = date.getHours()>=0 && date.getHours()<=9 ? "0"+date.getHours():date.getHours();
//分
var minutes = date.getMinutes()>=0 && date.getMinutes()<=9 ? "0"+date.getMinutes():date.getMinutes();
//秒
var seconds = date.getSeconds()>=0 && date.getSeconds()<=9 ? "0"+date.getSeconds():date.getSeconds();
var createdate = date.getFullYear() +"-"+ month +"-"+ day +" "+ hours +":"+ minutes +":"+ seconds;
return createdate;
}
标签:minutes ted cti 时分秒 ret var str 拼接 turn
原文地址:http://www.cnblogs.com/maochunyan/p/6813024.html