bgondy
bgondy

Reputation: 1328

Is DATE_RFC3339 PHP constant strictly equal to DATE_W3C

I'm using HTML5 and datetime input type. To set its value, I use a PHP DateTime object which iIformat to match with W3C Specification (actually by using DATE_RFC3339). I was wondering if DATE_RFC3339 was strictly equal to DATE_W3C as W3C say here.

To finish, I was wondering if 'Y-m-d\TH:i:s' was the good format for <input type="datetime-local" /> as we can use the following format (with millisceonds) : 1985-04-12T23:20:50.52.

Thanks in advance and please forgive my bad english.

Upvotes: 1

Views: 3857

Answers (1)

Mitch Satchwell
Mitch Satchwell

Reputation: 4830

Yes, they are identical.

From php.net documentation:

const string RFC3339 = "Y-m-d\TH:i:sP";
const string W3C = "Y-m-d\TH:i:sP";

http://php.net/manual/en/class.datetime.php

Upvotes: 4

Related Questions