显示更新表单的日期= date
当我更新注册数据时,我正在尝试显示保存在数据库中的当前日期。当我单击以更新寄存器时,所有带有input type = text
的字段显示在数据库中的数据中显示,但是具有input type type> input type = date
显示为MM /dd/yyyy,而不是存储的数据。是否可以在我的更新表单中显示使用input type = date
存储的日期?感谢您的帮助。 这是我的输入:
<label for="birth_date">Birth Date: </label>
<input
type="date"
class="form-control"
name="birth_date"
id="birth_date"
value="<%= patient.birth_date %>"
/>
I am trying to display the current date that is saved in my database when I'm updating the registered data. When I click to update the register, all the fields with input type=text
are shown with the data in the database, but the fields with input type=date
show as mm/dd/yyyy, instead of the data stored. Is it possible to show the date stored with the input type=date
in my update form? Thanks for helping.
Here is my input:
<label for="birth_date">Birth Date: </label>
<input
type="date"
class="form-control"
name="birth_date"
id="birth_date"
value="<%= patient.birth_date %>"
/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保
detter.birth_date
的值在yyyy-mm-dd
格式中。 mdnMake sure the value of
patient.birth_date
is inYYYY-MM-DD
format. The MDN documentation says: