Skip to content

Remove timezone to avoid timestamp in the future#14

Closed
iosoftgame wants to merge 1 commit intoslashequip:mainfrom
iosoftgame:remove_timezone
Closed

Remove timezone to avoid timestamp in the future#14
iosoftgame wants to merge 1 commit intoslashequip:mainfrom
iosoftgame:remove_timezone

Conversation

@iosoftgame
Copy link
Copy Markdown

I use a different timezone than UTC in Laravel (UTC+2), which makes the Segment implementation fail upon transfer to destinations because of "dates in the future" due to timezone confusion.

As DateTime automatically has UTC as default Timezone, removing this line of code should use the default Timezone of the Laravel project.

@slashequip
Copy link
Copy Markdown
Owner

@iosoftgame would something like this work for you;

$this->timestamp = $timestamp ?: now()->setTimezone('UTC')->toDateTime();

IIRC Segment can get a little funny about timezone and how it's formatted, ideally the package would always be sending in UTC for consistency. This change would set the timezone and shift the time as expected.

@slashequip slashequip closed this Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants