xn.
xn.

Reputation: 16046

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.

Upvotes: 3

Views: 1072

Answers (1)

xn.
xn.

Reputation: 16046

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" />

Upvotes: 4

Related Questions