Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove timezone to avoid timestamp in the future #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iosoftgame
Copy link

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

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