smgcknt-tech / traweather-react-app

1 stars 0 forks source link

When creating planData, the created date and time is saved in the database one day earlier than the actual date and time in created_at, causing a problem in the subsequent processing. #7

Closed smgcknt-tech closed 3 years ago

smgcknt-tech commented 3 years ago

Currently, there are no problems in the development environment. Therefore, it is presumed that the cause is in the production environment.

Possible cause 1 The time zone of Japan time is not set in moment.js. 2 Since created_at is UTC by default in AWS RDS postgres, the creation time is delayed by 9 hours and registered.

smgcknt-tech commented 3 years ago

Since the default time-zone of AWS RDS was UTC, it is probabliy a reason that the time of created_at was off by 9 hours. So, I created a parameter group dedicated to traweather in RDS and changed the time zone from UTC to Asia / Tokyo.

I check if the data can be created and posted without any problem before 9 o'clock this Saturday.

ref Amazon RDS】PostgreSQLのTimezoneを変更する
https://qiita.com/manabu55/items/57e1a3af1931d47f497c

smgcknt-tech commented 3 years ago

confirmed that this bug was fixed