• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 387
  • Last Modified:

JSON - How to format a Date String

Hi.
I have web service that returns a value like

/Date(1357142400000)/

How can I format like  'Jan 2  11:00 AM'

When I tried using the Date()  it returns

"Wed Jan 02 21:46:20 2013"    Which can't be correct.
0
JElster
Asked:
JElster
3 Solutions
 
Minh Võ CôngCommented:
0
 
JElsterAuthor Commented:
Hi..
I still don't see how to do it.
0
 
Sar1973Commented:
This function:
function myDateConverter() {
var myDate = new Date(1357142400000);
var myGMTDate=myDate.toUTCString();
}

Open in new window

will output "Wed, 2 Jan 2013 16:00:00 UTC".
0
 
Sar1973Commented:
Use then one or more between these functions and the JS string functions to create a customised date string.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now