Only Show Event Time

Home Forums Calendar Products Events Calendar PRO Only Show Event Time

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #58487
    336creative
    Participant

    Hello:
    I’m trying to only show the start time of an event. I have the event date in a separate section based on my design. I was trying to use the function below, but it isn’t working.
    php echo tribe_get_start_date($post->ID, true, ‘ ‘);

    Anyone have any advice on how to only show the start time as well as am/pm, and nothing else?

    Thanks!

    #58488
    snorton
    Participant

    Hey you can any date format you want!
    here’s what you want (just wrap in a php tag):
    echo tribe_get_start_date($post, false, $format = ‘g:i a’ );

    http://php.net/manual/en/function.date.php

    #58489
    336creative
    Participant

    Thanks for your help snorton. My issue above is that I’m trying to only display the start time, and not display the date at all. I have the date displayed elsewhere using the php time info.

    #58493
    snorton
    Participant

    The above won’t display your event date. tribe_get_start_date is the template tag to call the start date & time of the event for $post (current post), false turns off the time of the event (because it would otherwise display mm-dd-yyyy @ 00:00 AM – 00:00 PM), and $format readjusts to simply whatever date/time format you specify. In my example, this tag will only echo your start time in the format you asked for. If you changed false to true then it would display the start time in the specified format but still add @ 00:00 AM – 00:00 PM to the echoed text.

    #58496
    336creative
    Participant

    Oh gotcha! Thanks for the clarification and help. This is exactly what I was needing!!!

    #58845
    Leah
    Member

    Thanks for helping out here snorton!

    #979764
    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 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Only Show Event Time’ is closed to new replies.