• Resolved Ronen

    (@ronenschmitz)


    Im using this method to format a post date on my site:
    https://www.ads-software.com/support/topic/changing-date-format-12/

    It works fine in the main language of my site, which is english, and formatted like this: F j, Y

    How do I change this

    function su_post_shortcode_custom_date_filter( $value ) {
    	return date( 'M j, Y', strtotime( $value ) );
    }

    for multilingual sites so that the month would be written in German for example.
    I’m using WPML for translations.

    Thanks,
    Ronen

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter Ronen

    (@ronenschmitz)

    Ok, I found the answer myself on this page:

    Formatting Date and Time

    And the code changes to:

    function su_post_shortcode_custom_date_filter( $value ) {
    	return date_i18n( 'M j, Y', strtotime( $value ) );
    }

    Thanks for the great plugin!
    R

Viewing 1 replies (of 1 total)
  • The topic ‘Changing the Date Format for multilingual Sites’ is closed to new replies.