spatie / mailcoach-support

Questions and support for Mailcoach
https://mailcoach.app
31 stars 2 forks source link

"FIRST OPENED AT" takes the UTC time, not the local timezone #189

Closed w3bleads closed 4 years ago

w3bleads commented 4 years ago

PHP: 7.4.6 Laravel: 7.11.0

Mailcoach 1-Click Application Mailcoach: 2.11.8

In config/app.php timezone set America/Los_Angeles

Campaign->Statistics->Opens takes the UTC time, not my local timezone which is America/Los_Angeles

1 2 Thanks

riasvdv commented 4 years ago

All dates and times are shown in the same timezone, we've recently had some fixes on the feedback packages (they were not using the correct timestamps)

If updating the feedback packages doesn't work, could you elaborate some more on which dates & times you expect to see? That might help us solve the issue you're having

w3bleads commented 4 years ago

Updating to "2.13.0" version not resolve a problem Campaign->Statistics->Opens->"FIRST OPENED AT" show by UTC time, but I set in config/app.php "America/Los_Angeles" timezone (UTC-7) Others all dates and times work correctly. And I am using SES if its help.

w3bleads commented 4 years ago

Some data from mailcoach_campaign_opens and webhook_calls tables 1 PNG Screenshot_1

w3bleads commented 4 years ago

it helps me, but is it correct? in SesEvent public function getTimestamp(): ?DateTimeInterface { $eventType = strtolower($this->payload['eventType']); ` $timestamp = $this->payload[$eventType]['timestamp'];` // return $timestamp ? Carbon::parse($timestamp) : null; return $timestamp ? Carbon::parse($timestamp, 'UTC')->setTimezone('America/Los_Angeles') : null; }

riasvdv commented 4 years ago

I've released a new version of laravel-mailcoach-ses-feedback (2.2.2) that takes into account the app's configured timezone, let me know if that fixes your issue!