Listing event start and end time without date

Home Forums Calendar Products Events Calendar PRO Listing event start and end time without date

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #57043
    electricinteractive
    Participant

    Hi,

    We’re running single-day events, so I’m looking for a method of displaying the event start and finish time, but without the date attached. Currently I’m using:

    echo tribe_get_start_date($post->ID, true, ‘j M’);

    Which outputs something like: “5 DEC 6:30 PM”, but adding tribe_get_end_date adds the date again, when I just want it to show “5 DEC 6:30 PM – 8:30 PM”.

    Hope this makes sense. Thanks in advance for your help.

    #57057
    snorton
    Participant

    change the boolean to false (which will display just the date without not the time) and just echo the time format (http://php.net/manual/en/function.date.php) you’d prefer. If you just want the start time/finish time for an event in the 6:30 PM – 8:30 PM format, use:

    echo tribe_get_start_date($post, false, $format = ‘g:i A’ ) . ‘—’ . tribe_get_end_date($post, false, $format = ‘g:i A’);

    or if you want the Event Date with start and end time (5 DEC 6:30 PM – 8:30 PM) then:
    echo tribe_get_start_date($post, false, $format = ‘d M g:i A’) . ‘—’ . tribe_get_end_date($post, false, $format = ‘g:i A’);

    #57073
    electricinteractive
    Participant

    Just the answer I was looking for. Thanks so much, snorton – please mark this as resolved.

    #58027
    Leah
    Member

    Thank you snorton! electricinteractive, I’m glad to here you’re all good here. I’ll close the thread.

    #980006
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Listing event start and end time without date’ is closed to new replies.