I’m not familiar with time operations in javascript.
I tried new Date(); which gives the result in wrong format:
Thu Dec 24 2009 14:24:06 GMT+0800
How to get the time in format of 2009-12-24 14:20:57?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no cross browser Date.format() method currently. Some toolkits like Ext have one but not all (I’m pretty sure jQuery does not). If you need flexibility, you can find several such methods available on the web. If you expect to always use the same format then: