Custom Fields
Support General Choose the language of the date field

  • Creator
  • #10516
    Benjamin Pichonnaz

    Hello, I would like the format of the date is displayed in French and not in English, is it possible?

    rwmb_the_value(rw_date_prochaine_ceremonie, array(‘format’ => ‘j F Y’)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
  • #10535
    Anh Tran

    Yes, that’s possible. To output the date in a different format, please use this code:

    rwmb_the_value( $field_id, array( 'format' => 'F j, Y' ) );

    Benjamin Pichonnaz

    Thank you Anh Tran, I misspoke, sorry, I would like to translate the months, not change the format.

    Anh Tran

    I got it. Please use the date_i18n function as follows:

    $date = get_post_meta( get_the_ID(), 'field_id', true );
    echo date_i18n( 'F j, Y', $date );

    For more info, please check this docs.

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


Subscribe to our newsletter to receive news and tutorials for Meta Box and WordPress.

grid gear info copy caret-up caret-down trash