Hi,
I currently have some javascript code that returns a UTC date:
var d = new Date();
document.write (d.toUTCString());
This returns a string like this:
'Sun, 31 May 2009 20:03:23 UTC'
I want to eventually write this to a SQL server database so need to format the string to a sensible format. e.g. I want to convert the date to be in YYYY-MM-DD hh:mm:ss format.
How do I do this? Am a bit of a Js noob :O( e.g. in the above example I want to get 2009-05-31 20:03:23
Thanks,
MrPeds
I currently have some javascript code that returns a UTC date:
var d = new Date();
document.write (d.toUTCString());
This returns a string like this:
'Sun, 31 May 2009 20:03:23 UTC'
I want to eventually write this to a SQL server database so need to format the string to a sensible format. e.g. I want to convert the date to be in YYYY-MM-DD hh:mm:ss format.
How do I do this? Am a bit of a Js noob :O( e.g. in the above example I want to get 2009-05-31 20:03:23
Thanks,
MrPeds