Answers for "carbon parse timezone convert"

PHP
0

carbon now set timezone

Carbon::now('UTC')

//or 
now('UTC')
Posted by: Guest on May-27-2021
0

carbon change date timezone from one to utc

Carbon::createFromFormat('Y-m-d H:i:s', $some_date, 'UTC')
    ->setTimezone('America/Los_Angeles')
    
// First, you set the timezone you initially have, 
// so if you store your date in the database as UTC, 
// then set the default timezone to UTC, 
// then use ->setTimeZone('Valid/Timezone') 
// to make the change from what you'v had to the new timezone.
Posted by: Guest on November-11-2021

Browse Popular Code Answers by Language