Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why don't datetime fields with ISO 8601 values work in iOS webkit browsers?

Why doesn't the following datetime field display the current value in Safari or PhoneGap in iOS?

<input type="datetime" value="2013-05-22T10:00:00+0000" />

It displays a blank value.

like image 591
xn. Avatar asked Jan 23 '26 06:01

xn.


1 Answers

In iOS, datetime input fields only work with values in UTC, and only with the Zulu timezone designation. Neither local times nor UTC times with a +0000 offset are acceptable. The inclusion of milliseconds in the time are acceptable.

The following values work:

<input type="datetime" value="2013-05-22T10:00:00Z" />
<input type="datetime" value="2013-05-22T10:00:00.000Z" />

None of these work:

<input type="datetime" value="2013-05-22T10:00:00+0000" />
<input type="datetime" value="2013-05-22T10:00:00.000+0000" />
<input type="datetime" value="2013-05-22T10:00:00-0700" />
<input type="datetime" value="2013-05-22T10:00:00.000-0700" />
<input type="datetime" value="2013-05-22T10:00:00" />
<input type="datetime" value="2013-05-22T10:00:00.000" />
like image 151
xn. Avatar answered Jan 24 '26 20:01

xn.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!