SimpleDateFormat parserSDF = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzzz yyyy", Locale.ENGLISH);Date date = parserSDF.parse("Wed Oct 16 00:00:00 CEST 2013");…
function getNowFormatDate() { var date = new Date(); var seperator1 = "-"; var seperator2 = ":"; var month = date.getMonth() + 1; var strDate = date.getDate(); if (month >= 1 && month <= 9) { month = "0" + month…
var date = new Date(); var year = date.getFullYear(); var month = date.getMonth()+1; var day = date.getDate(); var hour = date.getHours(); var minute = date.getMinutes(); var time = year + "-" + (month < 10 ? "0" + month : month) +…
function getNowFormatDate() { var date = new Date(); var seperator1 = "-"; var seperator2 = ":"; var month = date.getMonth() + 1; var strDate = date.getDate(); if (month >= 1 && month <= 9) { …
//格式化时间 var format = function(time, format){ var t = new Date(time); var tf = function(i){return (i < 10 ? '0' : '') + i}; return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){ switch(a){ case 'yyyy': return tf(t.getFullYear()); break; case 'MM'…
function DateUtil(){}/***功能:格式化时间*示例:DateUtil.Format("yyyy/MM/dd","Thu Nov 9 20:30:37 UTC+0800 2006 ");*返回:2006/11/09*/DateUtil.Format=function(fmtCode,date){ var result,d,arr_d; var patrn_now_1=/^y{4}-M{2}-d{2}\sh{2}:m{2}:s{2}$/; var…
var format = function(time, format){ var t = new Date(time); var tf = function(i){return (i < 10 ? '0' : '') + i}; return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){ switch(a){ case 'yyyy': retu…
//格式化后日期为:yyyy-MM-dd HH:mm:ss function FormatAllDate(sDate) { var date = new Date(sDate); var seperator1 = "-"; var seperator2 = ":"; ; var strDate = date.getDate(); var hours = date.getHours(); var minutes = date.getMinutes(); var sec…