I am using CMB2 and following code to select date & time:
$cmb->add_field( array(
'name' => __( 'Test Date/Time Picker Combo (UNIX timestamp)', 'cmb2' ),
'desc' => __( 'field description (optional)', 'cmb2' ),
'id' => $prefix . 'datetime_timestamp',
'type' => 'text_datetime_timestamp',
) );
That code give me this in admin panel:
To retrieve this meta data I am using following code:
$text = get_post_meta( get_the_ID(), '_cmb2_event_date_prefix_datetime_timestamp', true )
echo esc_html( $text );
But this gives me a number as follow not the date and time I selected in admin panel.
1457368800
Why is this ? How can I get the date and time I selected in that meta box.
date_i18n
function. – Jevuska Mar 10 '16 at 8:12