0

I am getting a date using the plugin Meta Box.

The output is: "2014-10-30" and i'd like: "30/oct/2014"

There is a way to change the default format?

This is the register of the metabox:

$prefix = 'ns_';

'fields' => array(
            array(
                'name'  => 'Evento',
                'id'    => $prefix . 'event_date',
                'type'  => 'date',
            ),

And i'm calling it this way:

<?php echo rwmb_meta( 'ns_event_date' ); ?>

Thanks!

2

Probably but this would be using a PHP function along the lines of,

$metadate = rwmb_meta( 'ns_event_date' );
$date = new DateTime($metadate);
echo $date->format('d-M-Y');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.