2013-01-07 183 views
2

我有一個字符串看起來像這樣:字符串轉換爲日期在JavaScript

"2013/1/16" 

有什麼辦法,我可以迅速轉換成日期對象在JavaScript中,是這樣的:

convertToDateTime("2013/1/16", "yyyy/MM/dd") 
+0

看看這個:http://stackoverflow.com/questions/1056728/formatting-a-date-in-javascript –

+0

http://stackoverflow.com/questions/476105/how -can-i-convert-string-to-datetime-with-format-specification-in-javascript –

回答