-2

I have a service call that returns a datetime stamp from sql server database. I believe its gregorian calendar.

ex /Date(1355762048307+0000)/

I need to display this in a more readable format like MM/DD/YYYY hh:mm:ss. How can i do this in javascript of jquery?

Mike
  • 2,299
  • 13
  • 49
  • 71
  • 1
    [What have you tried?](http://whathaveyoutried.com) – Matt Ball Dec 17 '12 at 17:30
  • 1
    What problem are you having? Where are you stuck? `var d = new Date(1355762048307+0000), day = d.getDate(), mon = d.getMonth() + 1, year = d.getFullYear(); console.log(day + '/' + mon + '/' + year);` Reference: [`Date()`, at MDN](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date). – David Thomas Dec 17 '12 at 17:36
  • @DavidThomas: That does not work for other timezones. – Bergi Dec 17 '12 at 17:38

1 Answers1

1

Check out this question on how to parse a date string with that format to a Date object, and this one on how to format it.

Community
  • 1
  • 1
Bergi
  • 630,263
  • 148
  • 957
  • 1,375