标签:
{field: ‘Time‘, title: ‘时间‘, formatter: function (value, row, index) { var date = new Date(value); var year = date.getFullYear().toString(); var month = (date.getMonth() + 1); var day = date.getDate().toString(); var hour = date.getHours().toString(); var minutes = date.getMinutes().toString(); var seconds = date.getSeconds().toString(); if (month < 10) { month = "0" + month; } if (day < 10) { day = "0" + day; } if (hour < 10) { hour = "0" + hour; } if (minutes < 10) { minutes = "0" + minutes; } if (seconds < 10) { seconds = "0" + seconds; } return year + "/" + month + "/" + day + " " + hour + ":" + minutes + ":" + seconds; } },
另一个方法, 这个比较简单, 但是功能不如上面的好
{field:‘Time‘,title:‘时间‘, formatter:function(value,row,index) { var unixTimestamp = new Date(value); return unixTimestamp.toLocaleString(); } },
标签:
原文地址:http://www.cnblogs.com/wgbs25673578/p/5202098.html