Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

change returning datetime timezone to recalculate with user timezone laravel

// on a date column
$user->created_at->timezone('Asia/Kolkata')->toDateTimeString()

// Directly on a Carbon instance 
CarbonCarbon::parse('2018-01-22 04:09:31')->timezone('Asia/Kolkata')->toDateTimeString()


Check out these Links
Credit: https://laracasts.com/discuss/channels/laravel/change-date-timezone-in-laravel-project-while-fetching-date?page=1&replyId=576247
Actual Article: https://qcode.in/managing-users-timezone-in-laravel-app/
Source by qcode.in #
 
PREVIOUS NEXT
Tagged: #change #returning #datetime #timezone #recalculate #user #timezone #laravel
ADD COMMENT
Topic
Name
6+6 =