Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

datetime-local input not displaying value?

Tags:

html

php

datetime

I am trying to create a simple HTML form and the one element must capture the date and time, I am currently using:

 <input type="datetime-local" id="early" name="early" value="02/15/15T03:35">

However the issue is that it does not seem to populate the value of the element and just shows the normal blank values?

My format that datetime-local seems to show on Chrome is dd/mm/Y, --:-- (presumably hours:minutes)

Any help is appreciated as to the correct format?

Thanks!

like image 921
liamjnorman Avatar asked Jan 06 '23 17:01

liamjnorman


1 Answers

The correct format shoud be something like this YYYY-MM-DDTHH:MM or YYYY-MM-DDTHH:MM:SS where T is a string literal T Example

2016-02-01T03:35 or 2016-02-01T03:35:57

<input type="datetime-local" id="early" name="early" value="2016-02-01T03:35">

You can read and check the format here

like image 197
jameshwart lopez Avatar answered Jan 10 '23 20:01

jameshwart lopez