Documentation-Issue-Tracker icon indicating copy to clipboard operation
Documentation-Issue-Tracker copied to clipboard

[HelpHub] Feedback on Customize date and time format

Open zzap opened this issue 1 year ago • 5 comments

URL of the Page with the Issue

https://wordpress.org/documentation/article/customize-date-and-time-format/

Originally reported by

https://profiles.wordpress.org/junaidtahir/

Report content (issue description)

Please include guidance for setting up arabic or urdu language dates/time format

Section of Page with the issue

Why is this a problem?

Suggested Fix

zzap avatar Oct 08 '24 09:10 zzap

Heads up @WordPress/docs-issues-coordinators, we have a new issue open. Time to use 'em labels.

github-actions[bot] avatar Oct 08 '24 09:10 github-actions[bot]

Add the following content for Arabic or Urdu Date/Time Formats.

Using Arabic or Urdu Date/Time Formats

If your website is in Arabic or Urdu, you may want to display dates and times in a localized format.

1. Ensure Your Site Language is Set

  • Go to Settings → General
  • Find Site Language
  • Select العربية (Arabic) or اردو (Urdu)

2. Use Locale-Specific Date Formatting

WordPress automatically applies localized date formats when the correct site language is set. However, you can also use custom formats:

Arabic Format Example:

  • j F Y → ١ مارس ٢٠٢٤
  • D, d M Y → الجمعة، ٠١ مارس ٢٠٢٤

Urdu Format Example:

  • j F Y → ۱ مارچ ۲۰۲۴
  • D, d M Y → جمعہ، ۰۱ مارچ ۲۰۲۴

3. Use a Plugin for Full Localization Support

If your theme does not support localized numerals, you may use plugins like WP Date in Arabic or WP Jalali for enhanced support.

4. Customizing via Code (For Developers)

If you need to manually set the locale for date formatting, you can use:

setlocale(LC_TIME, 'ar_AE.utf8'); // Arabic (UAE)
echo strftime("%A, %d %B %Y"); // Example: الجمعة، ٠١ مارس ٢٠٢٤

By following these steps, you can properly display Arabic or Urdu date/time formats in WordPress.

karthick-murugan avatar Jan 30 '25 12:01 karthick-murugan

/assign

karthick-murugan avatar Jan 30 '25 12:01 karthick-murugan

Hey @karthick-murugan, thanks for your interest in this issue! 🍪🍪🍪
If you have any questions, do not hesitate to ask them in our #docs Slack channel.
Enjoy and happy contributing ❤️

github-actions[bot] avatar Jan 30 '25 12:01 github-actions[bot]

Heads up @docs-reviewers - the "[Status] Review" label was applied to this issue.

github-actions[bot] avatar Feb 05 '25 08:02 github-actions[bot]