2013-04-25 28 views

回答

2

我猜你需要使用Date.parseExact

Date.parseExact (String dateString, String formatStringOrArray) : Date

指定的字符串值轉換爲它的JavaScript日期 相當於使用指定的格式(字符串)或格式(陣列)。該字符串值的 格式必須完全匹配提供的格式 之一。

實施例:

Date.parseExact("25 Apr 2013 1200", "d MMM yyyy Hm"); 

REF:https://code.google.com/p/datejs/wiki/APIDocumentation#parseExact

相關問題