Support

Home Forums Event Espresso Premium iCal changing day to month and vice versa and sometimes showing 1/1/1970

iCal changing day to month and vice versa and sometimes showing 1/1/1970

Posted: July 3, 2014 at 5:38 am

Viewing 9 reply threads


Niels van D

July 3, 2014 at 5:38 am

Hi there,

This problem cannot be resolved by changing month to day and vice versa in ical.php since in another event the date is just set to 1/1/1970 – this doesn’t changes with this edit. What can be the problem? Should clearly have to do with European and US date notation, however, notation is set to our standards in the settings.

Best, Niels


Dean

July 3, 2014 at 6:07 am

Hi,

Can you check that the event has both a Registration start and end date, as well as an Event start and end date.

Can you check what format those appear in the event editor as well please?


Niels van D

July 3, 2014 at 6:14 am

Yes, both have and the format set in current date is: 03/07/2014 12:12
In the editor startdate is shown as: Startdatum 09/10/2014

See for yourself, date appears ok but in ical link its wrong:
http://www.gcsl.eu/agenda/?ee=3


Dean

July 3, 2014 at 6:31 am

Thanks for that. With one event showing a correct ical and another not, I have to assume it is the date settings. Can you screenshot the date section of the event editor for the event with the issue please?


Niels van D

July 3, 2014 at 7:24 am

No, both are wrong http://www.gcsl.eu/agenda/
– The first mixes up month and day (10 september instead of 9 oktober)
– The second displays 1-1-1970 instead of whats been given


Josh

  • Support Staff

July 3, 2014 at 12:00 pm

Hi Niels

Can you post screenshots of the date section of the event editor for the events please?


Niels van D

July 15, 2014 at 1:16 am

Hi there,

Please find two screenshots here, the first turns around month and day, the second sets at 1-1-1970:
http://www.boosza.com/gcsleu.boosza.com//dump/Turns%20around%2010%20and%2009.jpg
http://www.boosza.com/gcsleu.boosza.com//dump/Sets%20at%201-1-1970.jpg

Thanks, Niels


Dean

July 15, 2014 at 3:33 am

Hi,

Thanks for the screenshots and the date clarification.

I am going to raise a developer ticket to look into this as I am seeing the issue now, EU style dates with slashes seem to be showing an error for some reason.


Josh

  • Support Staff

July 15, 2014 at 12:32 pm

Hi Niels,

The simplest fix I can share with you is to use d-m-Y instead of d/m/Y. While the WordPress > Settings general page gives d/m/Y as an option, it turns out it’s not a valid date format that can be used with PHP functions. Here is one example from the official PHP documentation for the strtotime function:

Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed.
To avoid potential ambiguity, it’s best to use ISO 8601 (YYYY-MM-DD) dates or DateTime::createFromFormat() when possible.

from: http://php.net/manual/en/function.strtotime.php

After you change the date format to d-m-Y, you will need to re-save the events so that the event meta gets refreshed to use the new format. (The event meta is where the ical dates are pulled from).


Niels van D

July 18, 2014 at 2:10 am

Dear Josh,

Thank for your comprehensive reply, that little change seems to have done the trick.

Many thanks, Niels

Viewing 9 reply threads

The support post ‘iCal changing day to month and vice versa and sometimes showing 1/1/1970’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso