在 jqGrid 中,如何将时间戳格式化为 dd/mm/yyyy 格式 [英] In jqGrid, how to format timestamp to dd/mm/yyyy format
本文介绍了在 jqGrid 中,如何将时间戳格式化为 dd/mm/yyyy 格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用程序将时间戳数据发送到 jqgrid(如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屋!
查看全文