Issue
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?
Solution
I think using format
only can do the trick. Try it and let me know.
$dataTimeFromDb->format('Y-m-d H:i')
Answered By - Marios Nikolaou
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.