Date Time format in JavaScript.

Posted by Allemahesh under JavaScript on 7/11/2013 | Points: 10 | Views : 783 | Status : [Member] [MVP] | Replies : 2
I have a date-time in hidden field coming form code. I am accessing this values in JavaScript. Now I want to convert this data to "yyyy-mm-dd hh:mm:ss tt" in JavaScript. Can any one help me.




Responses

Posted by: Jitendrasoft09 on: 7/12/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hello Allemah,

Please look into below code for changing format of date-time in javascript, refer below link for information.
http://blog.stevenlevithan.com/archives/date-time-format

dateFormat(now, "dddd, mmmm dS, yyyy, h:MM:ss TT");


or

now.format();


Hope you are clear..

Jitendra Kumar
If my post helps you, plz mark as an answer.

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 7/15/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
I am getting the below error:-
dateFormat is not defined.
Any help.

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response