在jqGrid中,如何将时间戳格式化为dd/mm/yyyy格式 [英] In jqGrid, how to format timestamp to dd/mm/yyyy format

查看:459
本文介绍了在jqGrid中,如何将时间戳格式化为dd/mm/yyyy格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序将时间戳数据发送到jqgrid (like "1268913728759").

My application send timestamp data to jqgrid (like "1268913728759").

现在我想像dd/mm/yyyy一样格式化它.

now i want to format it like dd/mm/yyyy.

jqGrid中,我添加了以下行,但行不通

In jqGrid I added following line but it doesn't worked

{name:'testDate',index:'testDate', width:100, formatter:'date', formatoptions: {srcformat: 'ts',newformat:'d/m/Y'}}

推荐答案

这种情况下正确的现象应该是这样的:

The correct seetings for this case should be like this:

formatter:'date', formatoptions: {srcformat: 'U', newformat:'d/m/Y'}

"U"是自Unix纪元以来的第二个"日期格式的格式字符.

The 'U' is format character for 'Seconds since the Unix Epoch' date format.

这篇关于在jqGrid中,如何将时间戳格式化为dd/mm/yyyy格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆