invoker-community icon indicating copy to clipboard operation
invoker-community copied to clipboard

[Bug]: Date and time do not match if "app.timezone" is not in UTC

Open kzfk opened this issue 6 months ago • 0 comments

Operating system

Windows11 23H2 (22631.3958)

Laravel Version

v10.47.0

PHP Version

PHP 8.2.13 built: Nov 24 2023 08:47:18

Project Location

Remote (Server)

Bug description

We had this problem before, but the time zone specification on the server side was UTC.

  • https://github.com/beyondcode/invoker-community/issues/113

However, if the timezone key in app/config.php on the server side is changed to something other than UTC, the time displayed in Invoker will not match.

Perhaps the datetime type values such as created_at are assumed to be in UTC and converted when displayed.

> config("app.timezone")
= "Asia/Tokyo"

> EventDivisionPrice::first()
= App\Models\EventDivisionPrice {#6237
    id: 1,
    event_id: 1,
    division_id: 1,
    price: 20000.0,
    created_at: "2024-03-14 12:32:53",
    updated_at: "2024-03-14 12:32:53",
  }

> EventDivisionPrice::first()->created_at
= Illuminate\Support\Carbon @1710387173 {#5516
    date: 2024-03-14 12:32:53.0 Asia/Tokyo (+09:00),
  }

The time zone of this PC is "Asia/Tokyo" time zone (UTC+9) image

Steps to reproduce

  1. Set "timezone" in app/config.php to something other than UTC. Example: 'timezone' => 'Asia/Tokyo',

Relevant log output

No response

kzfk avatar Aug 13 '24 09:08 kzfk