javascript - 如何显示输入类型 ="datetime-local"的值?

标签 javascript date datetime input time

我的代码是这样的:

<div id="output">test</div>
<div><input type=date value="2018-02-27"><button>Get</button></div>
<div><input type=time value="21:10"><button>Get</button></div>
<div><input type=datetime-local value="2018-02-27 21:10"><button>Get</button></div>

这样的演示:

http://jsfiddle.net/BP5kC/42/

输入类型日期和输入类型时间成功显示该值。但是输入类型datetime-local没有成功显示值

我使用最新的chrome浏览器(版本64.0.3282.186(官方版本)(64位))来尝试

如何解决该错误?

最佳答案

格式应为2018-02-27T21:10。您忘记写T

<input type=datetime-local value="2018-02-27T21:10">

关于javascript - 如何显示输入类型 ="datetime-local"的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49004669/

相关文章:

javascript - ReactJS ES6 函数绑定(bind) - 未捕获的类型错误 : Cannot read property 'update' of undefined

javascript - Promise 链内循环

javascript - react : why child component doesn't update when prop changes

java - Java中OffsetDateTime字符串与OffsetDateTime.now()的比较

r - 在 R 中*快速*将字符转换为日期

javascript - react-native-image-picker 未定义

使用 DateTimeFormatter 解析 AM/PM 时间时出现 Java 8 DateTimeParseException

python - OLS 与 Pandas : datetime index as predictor

php - 需要时区调试帮助

c# - 设置日期和月份格式,但不是他们的顺序