WPML allows you to have different date formats for different languages on your site. You can also use this method for using different timestamp formats.
In the following example, we will be setting different date formats for English and French versions of a blog post.
To do this, we will need to first set the date format for our default language. Then, we can set the format for any secondary languages.
Set the date format for the default language
Options for date format are located on the Settings → General page. You can choose one of the predefined values or enter your own format.
Set the date format for secondary languages
Once you set default date format, you can set the date format for your other languages. Use the following steps to do this:
-
- Go to the WPML → String Translation page. Scroll down and click the Translate texts in admin screens link.
-
- On the Admin Texts Translation page, search for and select the checkboxes for the date_format and time_format fields. Then click Add to String Translation.
- Go back to WPML → String Translation, and you will see admin_texts_time_format and admin_texts_date_format at the top of the list of strings. If you don’t see them at the top of the list, you can search for them using the text search field.
- In the Select strings within domain dropdown select admin_texts_time_format and translate the time format.
- Translate the strings as normal. In the example, we translated the date format into French as d/m/Y.
Once you are done with translating these strings, your site’s front-end will display dates in the format you chose for each language.