someline / someline-starter

Someline Starter is a PHP framework for quick building Web Apps and Restful APIs, with modern PHP design pattern foundation.
https://starter.someline.com/
839 stars 169 forks source link

How to change timezone? #58

Closed crazcdll closed 7 years ago

crazcdll commented 7 years ago

I want to change the timezone, I have changed the timezone in config/app.php to 'timezone' => 'PRC'. And when I check the database, I found the field I added myself showed the correct time, however the default field added by the Framework itself created _at, updated_at showed the UTC time.

I want to know whether exits a place to change the framework timezone?

Thx!

skyeryg commented 7 years ago

In your app\Models\BaseModel.php Add


protected $timestamp_always_save_in_utc = false;
protected $timestamp_get_with_user_timezone = false;
crazcdll commented 7 years ago

It's done!

Thanks a lot!