There seems to be a million questions here on converting a string to a Date, but not vice-versa. When I convert a Date object to a string using mydate.toString
I get a string in the format 16/01/2013 13:00:00
.
But what I really want is 2013-01-16 13:00:00
. I can't see any functions on the Date object that do this for me, do I need to use a regex or something instead?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…