Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

It isn't an issue with Laravel, it is an issue with PDO, which Laravel uses for making database queries.

For more info see this other question: PHP How to return datetime(6) from Mysql?PHP How to return datetime(6) from Mysql?

or the actual bug report

http://grokbase.com/t/php/php-bugs/11524dvh68/php-bug-bug-54648-new-pdo-forces-format-of-datetime-fields

You can pull microseconds by using a DB::select() statement. For example:

$test = DB::select("SELECT id, DATE_FORMAT(date, '%Y-%m-%d %H:%i:%f') as date FROM test");

It isn't an issue with Laravel, it is an issue with PDO, which Laravel uses for making database queries.

For more info see this other question: PHP How to return datetime(6) from Mysql?

or the actual bug report

http://grokbase.com/t/php/php-bugs/11524dvh68/php-bug-bug-54648-new-pdo-forces-format-of-datetime-fields

You can pull microseconds by using a DB::select() statement. For example:

$test = DB::select("SELECT id, DATE_FORMAT(date, '%Y-%m-%d %H:%i:%f') as date FROM test");

It isn't an issue with Laravel, it is an issue with PDO, which Laravel uses for making database queries.

For more info see this other question: PHP How to return datetime(6) from Mysql?

or the actual bug report

http://grokbase.com/t/php/php-bugs/11524dvh68/php-bug-bug-54648-new-pdo-forces-format-of-datetime-fields

You can pull microseconds by using a DB::select() statement. For example:

$test = DB::select("SELECT id, DATE_FORMAT(date, '%Y-%m-%d %H:%i:%f') as date FROM test");
Source Link
Pitchinnate
  • 7.6k
  • 1
  • 21
  • 39

It isn't an issue with Laravel, it is an issue with PDO, which Laravel uses for making database queries.

For more info see this other question: PHP How to return datetime(6) from Mysql?

or the actual bug report

http://grokbase.com/t/php/php-bugs/11524dvh68/php-bug-bug-54648-new-pdo-forces-format-of-datetime-fields

You can pull microseconds by using a DB::select() statement. For example:

$test = DB::select("SELECT id, DATE_FORMAT(date, '%Y-%m-%d %H:%i:%f') as date FROM test");