dimanche 29 décembre 2019

Convert data in Laravel 5.8 dive wrong result

I am beginner in Laravel. I use in my project Laravel 5.8. I have this code:

$dataTimeFromDb = '2019-12-28T23:54:04.000000Z';
$userLastActivity = Carbon::parse($dataTimeFromDb)->format('Y-m-d H:m');

In result I have: 2019-12-29 00:12.

I need value from DB in format: Y-m-d H:m. My timezone is Warsaw/Berlin and I save in this format in DB.

How can I repeir it?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire