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 years, 11 months ago by
Bastien Ho.
Thread Starter
akalwp
(@akalwp)
<?php the_date_start();?>
Perfect !
Thx 😉
Akal
Hi,
is it possible to have nothing written instead of 01/01/1970?
i’m using this way:
<?php echo date(‘m/d/Y H:i’ , strtotime(get_post_meta( get_the_ID(), ‘event_begin’, true )) ); ?>
Anne
Hi,
i have found how to 🙂
$key_date_begin_value = get_post_meta( get_the_ID(), ‘event_begin’, true );
$key_date_end_value = get_post_meta( get_the_ID(), ‘event_end’, true );
// Check if the custom field has a value.
if ( ! empty( $key_date_begin_value )||! empty( $key_date_end_value ) ) {
$output .= ‘<span class=”post-date”>’ .$key_date_begin_value.’ ‘.$key_date_end_value;
}else{
$output .= ‘<span class=”post-date”>’. get_the_date() .'</span>’;
}
but to add the format I continue to search…
if someone knows the solution, I’m interested
Anne