Ad
Carbon Auto Increments Time By 11 Minutes On Parse
I am using Carbon with Laraveal, my local timezone is in IST. I am passing the below ISO string from the UI.
2019-11-22T03:00:00.000Z
When parsed on the server with the below syntax:
\Carbon\Carbon::parse($value)->timezone($this->user->timezone)->format('Y-m-d H:m:s');
The output I am getting is :
2019-11-22 03:11:00
Don't know why I am getting the additional 11 minutes in the time. UI and Server both runs in my local machine. Don't know what's causing the 11 minutes addition.
Ad
Answer
->format('Y-m-d H:m:s');
should be
->format('Y-m-d H:i:s');
Notice the m
for months and i
for minutes.
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms
Ad