beyondcode / beyondcode/invoker-community

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

Open
#389 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
76
Forks
1
PR merge metrics
No merged PRs in 30d

Description

### 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.

```php
> 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](https://github.com/user-attachments/assets/e9186219-a2ad-4d6e-be4e-2ca130503fde)

### Steps to reproduce

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

### Relevant log output

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.