HTML form input type datetime-local result string missing seconds when select seconds are selected to zero

I have a form with an input created like this:

<?php echo '<input type="datetime-local" name="manualDateTime" value="'.$DateTimepicker.'" step=1><br>'.PHP_EOL; ?>

      

When I install the collector from Chrome outside of business hours, I get the expected var dump result, e.g .:

string(19) "2015-07-18T10:07:52"

      

However, if I install the collector before midnight, I get a shorter result missing in seconds:

string(16) "2015-07-17T00:00"

      

It wreaks havoc on subsequent code like DateTime :: CreateFromFormat and it seems like I need to code an exception to do this.

Is there a way to ensure that the returned string from the collector for the input type of the datetime-local form always has a consistent format?

+3


source to share





All Articles