Datetime field in local language?

Support General Datetime field in local language?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #39215
    TobiasTobias
    Participant

    Hello,

    I have a query loop and added the following code to give me the Year and the Months of the CPT entry:

    <p><?php rwmb_the_value( 'events-datetime_s5ayomw3uvn', ['format' => 'Y'] ) ?> <?php rwmb_the_value( 'events-datetime_s5ayomw3uvn', ['format' => 'F'] )

    ?>

    But now it gives me the Month in English. How to give me the Month in my local language?

    #39216
    TobiasTobias
    Participant

    It's for an Events Archive Page. That has several events in different months.

    #39217
    TobiasTobias
    Participant

    Ok I managed it via this code:

    <?php
    $date = get_post_meta( get_the_ID(), 'YOURCUSTOMFIELD', true );
    $date = date_i18n( 'F', strtotime( $date ) );
    echo $date;
    ?>

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