I've a problem to retrieve datetime(6)
field from MySQL 5.7 table.
If I run it directly from mysql client, it works:
mysql> SELECT arrival from table1 limit 1;
+----------------------------+
| arrival |
+----------------------------+
| 2016-06-22 16:52:06.260000 |
+----------------------------+
1 row in set (0.00 sec)
mysql>
but getting the field from Laravel using Eloquent, the microsecond are not reported:
class Table1Model extends Model
{
protected $table = 'table1';
}
class Table1Controller extends Controller
{
public function index()
{
$data = Table1Model::first()->arrival;
dd($data);
}
}
// the output is: "2016-06-22 16:52:06"
Is this an Eloquent problem? How get the microsecond?
Thank you.