-1

I want to convert datetime format from 2015-03-17T06:14:49.2295964Z to 17/03/2015 06:15 AM via jquery or JavaScript.

Can you please help me understand this first format?

I have a controller method which returns datetime to ajax call i want to display this in 17/03/2015 06:15 AM format but it is in 2015-03-17T06:14:49.2295964Z format.

How can i convert it? Any help will be appreciated.Thanks.

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
Wasfa
  • 266
  • 5
  • 29
  • if possible, look at moment.js. full set of function to play with date time in javascript. – Aman Gupta Mar 17 '15 at 06:53
  • No i am using simple JavaScript to display dateTime retunred by controller. – Wasfa Mar 17 '15 at 07:06
  • I doubt, if native JavaScript has any set of function to do that for you. There might be some addition done in ECMA-6 but not sure. as of now I could suggest to write your own function to format it, its easy though. have a look on this question. http://stackoverflow.com/questions/3552461/how-to-format-javascript-date – Aman Gupta Mar 17 '15 at 09:17

1 Answers1

0

Try this code. This is a jQuery code. See https://github.com/phstc/jquery-dateFormat

$.format.date("2009-12-18 10:54:50.546", "Test: dd/MM/yyyy");
Alvin Magalona
  • 771
  • 3
  • 13