/** * example new Date(times) * @param time Date * @param fmt "yyyy-MM-dd" /"yyyy-MM-dd hh:mm:ss" * @returns String */ function dateString (time, fmt) { var o = { "M+": time.getMonth() + 1, //月份 "d+": time.getDate()
function formateDate(timestamp){ var date = new Date(timestamp); var y = 1900+date.getYear(); var m = "0"+(date.getMonth()+1); var d = "0"+date.getDate(); return y+"-"+m.substring(m.length-2,m.length)+"-"+d.substrin
获取当前时间 func Now func Now() Time 1 Now returns the current local time. func (Time) UTC func (t Time) UTC() Time 1 UTC returns t with the location set to UTC. func (Time) Unix func (t Time) Unix() int64 1 Unix returns t as a Unix time, the number of se