function formatDate(strDate) { try{ var date = new Date(strDate); var timeoffset = (new Date().getTimezoneOffset()) * 60 * 1000; var len = date.getTime(); var date2 = new Date(len - timeoffset); return date2.getFullYear() + "/" + (date2.getMonth() + 1) + "/" + date2.getDate(); }catch(e){return ""} }
传入0时区时间,输出本地时间