jquery 毫秒转换成日期_将JQGrid的毫秒数转换为日期格式

My Jqgrid's data source is a php which returns a json

The date constraint in the returned json is in milliseconds

I want to convert it to regular date format

I tried searching for a solution the one that got real close to solution is the one given [below

JQ Grid Date Format

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

But still it doesn't fix my issue as the date is not formulated right 24/10/146

which is not the correct date at all

Looking forward to some worthy fixes or suggestions

1394085600000 which is the returned json data should essentially be 03/06/2014

thanks in advance

解决方案

I figured out the solution myself

Thanks for the inputs @oleg

But the issue was the input being milliseconds and the formatter src format was "U" which is unix and milliseconds/1000 will provide the unit in Unix

So as for now {srcformat: 'U/1000', newformat:'Y/d/m'} gives me the right date format but

It doesn't kinda make sense though

But still keeping the question open for legitimate answer

thanks

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值