Support » Plugin: Event post » Display begin date in template

  • Resolved akalwp

    (@akalwp)



    Hi,
    me again ^^
    Currently I’m using <?php echo get_post_meta( get_the_ID(), ‘event_begin’, true ) ; ?> in page template, which display date like 2018-10-01 00:00:00
    How could I echo the event date (event_begin) in human way like 01 oct 2018 ?
    Thx
    Akal

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bastien Ho

    (@bastho)

    Hi,

    The easy way, which will crash if you deactivate the plugin:

    
    <?php the_date_start();?>
    

    The coder way:

    
    <?php echo date('m/d/Y H:i' , strtotime(get_post_meta( get_the_ID(), ‘event_begin’, true ))  ); ?>
    

    (replace with the appropriate time format)

    Or use the built-in WordPress function date_i18n()

    Hope it helps

    • This reply was modified 2 months, 4 weeks ago by  Bastien Ho.

    <?php the_date_start();?>
    Perfect !
    Thx 😉
    Akal

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.