0

请如何从输入类型“日期”中恢复日期对象..因为返回是一个字符串

创建一个新的 Date 对象实例

Date :<input type="date" name="anniversaire">
Date d = new Date () / / from input
4

1 回答 1

1

您可以使用像moment这样的第三方库

moment("11-06-1013", "MM-DD-YYYY");

或自己解决所有跨浏览器问题并使用以下内容:

new Date("11-06-1013")
于 2013-11-06T15:41:57.827 回答