user3298503
user3298503

Reputation: 11

Convert data in milliseconds to date in ext-js without timezone

In ext-js , I have a data in millseconds ..eg;850248000000 for DOB field. it is what i get from server side.

I need to convert this to Date format to be shown in a browser. Time Zone at the Client Side should not affect the conversion.

Appreciate your help.

kp

Upvotes: 1

Views: 2574

Answers (1)

leoh
leoh

Reputation: 10608

The first thing to know would be what the time means(thanks @Teo). If it's epoch time in ms, the following might work for you

var d = new Date(850248000000)

console.log(d.toGMTString())

>>>Tue, 10 Dec 1996 20:00:00 GMT VM309:2

console.log(d.toLocaleString())

>>>12/10/1996 3:00:00 PM VM310:2

Upvotes: 3

Related Questions