Support » Plugin: Event Tickets » BUG: ticket_end_date gets wrong time (1970-01-01)

  • Resolved saulirajala


    I have the following problem:
    1) I create a new event.
    2) I add a new ticket to that event.
    3) I set a end date, when one can no longer buy tickets (e.g. ticket_end_date). I don’t set end hour but rather leave it as default, which is ’17’, because I live in an area where we use 24 hour clock.
    4) I save the ticket and see the end date of ticket and it is 1970-01-01

    I have done some research on this issue and noticed that it happens because I can set hours greater than 12 but there is still am/pm setting available. When clicking Save ticket -button, ticket_add() function in file Tickets.php will be executed. This function in row 573 tries to create strtotime() of string that might not be valid time. For example ‘2018-03-03 17:00:00pm’. This why $ticket->end_date will be ‘1970-01-01 12:00:00am’

Viewing 2 replies - 1 through 2 (of 2 total)
  • patriciahillebrandt


    Hey @saulirajala,

    Thank you for reaching out to us!

    I hope you’re having a good week/day. Firstly, I’d like to apologize for the delay in response. Thank you for your patience all this while!

    While having all Modern Tribe plugins and Twenty Seventeen theme enabled I wasn’t able to reproduce the issue you ar experiencing from here: under Settings > General, if I have the Time Format set to 00:00 am or 00:00 AM, the ticket submission form won’t allow me to post start/end sales times at 17:00h (with the 24h/military time format): only at 5:00pm.

    This sounds like a plugin or theme conflict that is altering the way the time format is handled by Event Tickets. I’ve worked with a similar case in the past where our plugins were conflicting with Advanced Custom Fields (AFC) PRO and causing this same issue you are experiencing.

    So to help you get started, I would recommend you to run a Conflicts Test. You can start the test by temporarily deactivating all of your plugins (except Modern Tribe plugins) and changing your theme to another one like Twenty Seventeen and let us know if the problem is solved after that (don’t forget to backup your database before changing anything).

    Best Regards,


    Thread Starter saulirajala


    Hi Patricia,

    I did that already and result is the same. For reproducing the bug you have to set Date format to d.m.Y and Time format to G:i. But I know see, that you have changed the UI in the latest version. This UI change also fixed the bug that I described in this ticket. So all is good no. Sorry for the noice.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘BUG: ticket_end_date gets wrong time (1970-01-01)’ is closed to new replies.