0

i have some table and there are column date with value : 2021-07-01 10:00:00

when im fetching that, with ->get() or ->first() or anything of method in laravel to fetch data, i have difference result, look like the value has formated / converted to another timezone, but in laravel config or env , i dont set anything about configuration of timeszone, i has googling but not finding , can somebody tell me about this case, or maybe iam must be set some config to get proper value?

1
  • what is your SQL timezone set as Commented Jul 24, 2021 at 11:56

1 Answer 1

1

There are two ways to update your code. 1- open config/app.php and edit

'timezone' => 'UTC',

Here you can add your timezone like

'timezone' => 'Asia/Tokyo',

If you want to manage your timezone from .env file you can use this code

'timezone' => env('APP_TIMEZONE', 'UTC'),

and add the this line in your .env file.

APP_TIMEZONE='Asia/Tokyo'

Sign up to request clarification or add additional context in comments.

1 Comment

not affected, iam still have difference value

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.