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

Daylight savings (CET vs CEST?) #65

Open
avonian opened this issue Mar 16, 2021 · 3 comments
Open

Daylight savings (CET vs CEST?) #65

avonian opened this issue Mar 16, 2021 · 3 comments

Comments

@avonian
Copy link

avonian commented Mar 16, 2021

Hi there,

First off wonderful package thank you for your awesome contribution :)

I'm confused as to why @displayDate($event->event_date) is returning a time in CEST right now for a user in 'Europe/Paris' when we're not yet in CEST.

The date time on the environment is accurately showing March 16 2021, so not an env issue.

Is something that needs to be toggled manually?

@jamesmills
Copy link
Owner

Hi @avonian

Thank you for your kind comments. It's nice to know that people value the package and use it in the wild!

I can only assume that this is some issue with the server time.

Can you do this and see what results we get?

{{ Carbon::now()->format('jS F Y g:i:a e T') }}

{{ $event->event_date->format('jS F Y g:i:a e T') }}

@displayDate($event->event_date, 'jS F Y g:i:a e T')

@avonian
Copy link
Author

avonian commented Mar 17, 2021

Hi james, thanks so much for the reply.

Here's what I've got:

  • {{ Carbon\Carbon::now()->format('jS F Y g:i:a e T') }}
    17th March 2021 2:11:pm US/Eastern EDT
  • {{ $event->event_date->format('jS F Y g:i:a e T') }}
    24th April 2021 11:00:am US/Eastern EDT
  • @displayDate($event->start_date, 'jS F Y g:i:a e T')
    24th April 2021 5:00:pm Europe/Madrid CEST

And the system date is set to Wed Mar 17 18:12:14 UTC 2021

@jamesmills
Copy link
Owner

Howdy!

Ok, so I've no clue! lol.

What is the timezone value set on the user? Because the the package just takes that and converts the event date to that timezone.

$timezone = (auth()->user()->timezone) ?? config('app.timezone');
$date->setTimezone($timezone);

So I'm not technically sure who/what decides when it's daylight saving or not. I assumed the system/php had some magic to work this out so I wouldn't have though this should be a problem.

Hummmmm

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

No branches or pull requests

2 participants