Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298064

DateTimePlus::createFromFormat does not accept microseconds despite claiming compatibility

$
0
0

The 'u' format flag is not recognised. Simple example:

use Drupal\Component\Datetime\DateTimePlus;

$autoloader = require_once 'autoload.php';

$f = 'Y-m-d\TH:i:s.u';
$s = '2015-04-22T00:28:15.473';

$p = DateTimePlus::createFromFormat($f, $s);

var_dump ($p);

This affects for example the migrate module: you cannot easily handle a date like: "2015-04-22T00:28:15.473Z" which I think is commonly generated in the Microsoft world.


Viewing all articles
Browse latest Browse all 298064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>