例如:
? yyyy-MM-dd HH:mm:ss
? 方法一:实体类中添加时间转换注解(注意时区问题)
/**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date startTime;
{
                    field : 'crtTime',
                    title : '创建时间',
                    width : 100,
                    sortable :true,
                    align : 'center',
                    formatter : crtTimeFtt
                },
方法二,js处理:
 var dateTime = new Date().getTime();
function add0(m){return m<10?'0'+m:m }
            function format(shijianchuo)
            {
            //shijianchuo是整数,否则要parseInt转换
                var time = new Date(shijianchuo);
                var y = time.getFullYear();
                var m = time.getMonth()+1;
                var d = time.getDate()+1;
                var h = time.getHours()+1;
                var mm = time.getMinutes()+1;
                var s = time.getSeconds()+1;
                return y+'-'+add0(m)+'-'+add0(d)+' '+add0(h)+':'+add0(mm)+':'+add0(s);
            }
           var date = format(dateTime);
原文:https://www.cnblogs.com/charlypage/p/9490780.html