?
Solved

JSON - How to format a Date String

Posted on 2013-01-02
5
Medium Priority
?
384 Views
Last Modified: 2013-01-04
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
Comment
Question by:JElster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 15

Assisted Solution

by:Minh Võ Công
Minh Võ Công earned 498 total points
ID: 38738914
0
 
LVL 39

Assisted Solution

by:Pratima Pharande
Pratima Pharande earned 501 total points
ID: 38738950
0
 
LVL 1

Author Comment

by:JElster
ID: 38739773
Hi..
I still don't see how to do it.
0
 
LVL 9

Accepted Solution

by:
Sar1973 earned 501 total points
ID: 38743319
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
 
LVL 9

Expert Comment

by:Sar1973
ID: 38743369
Use then one or more between these functions and the JS string functions to create a customised date string.
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question