Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Change post date format to hebrew calendar

Disclaimer

This is not a complete answer, because I can’t really handle signs I don’t know. It should help to point you in the right direction.

My (basic) solution

Taken from StackExchange, I created this function for your functions.php:

function ArabicDate( $time = false ) {

    if ( $time === false ) {
        $time = current_time( 'timestamp' );
    }
    $months = array("Jan" => "يناير", "Feb" => "فبراير", "Mar" => "مارس", "Apr" => "أبريل", "May" => "مايو", "Jun" => "يونيو", "Jul" => "يوليو", "Aug" => "أغسطس", "Sep" => "سبتمبر", "Oct" => "أكتوبر", "Nov" => "نوفمبر", "Dec" => "ديسمبر");
    $your_date = date( 'y-m-d', $time ); // The Date calculated from the $time variable
    $en_month = date("M", $time );
    foreach ($months as $en => $ar) {
        if ($en == $en_month) { $ar_month = $ar; }
    }

    $find = array ("Sat", "Sun", "Mon", "Tue", "Wed" , "Thu", "Fri");
    $replace = array ("السبت", "الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة");
    $ar_day_format = date('D', $time); // The Current Day
    $ar_day = str_replace($find, $replace, $ar_day_format);

    $standard = array("0","1","2","3","4","5","6","7","8","9");
    $eastern_arabic_symbols = array("٠","١","٢","٣","٤","٥","٦","٧","٨","٩");

    // use this line to format your arabic date
    $current_date = $ar_day.' '.date( 'd', $time )."https://wordpress.stackexchange.com/".$ar_month."https://wordpress.stackexchange.com/".date( 'Y', $time );
    $arabic_date = str_replace($standard , $eastern_arabic_symbols , $current_date);

    return $arabic_date;

}

This is not the best solution, as you have to hardcode the timeformat for your arabic date. I would love to do better, but I have no idea how to confirm if the output of the signs is correct.

Change $ar_month to date( 'm', $time ) if you want the month to be numbers, not the month in text, for example.

Afterwards, you can filter your date function with this code:

add_filter( 'get_the_date', 'f711_convert_to_arabic_date', 10, 3 );
function f711_convert_to_arabic_date( $the_date, $d, $post ) {
    $posttime = strtotime( $post->post_date );
    return ArabicDate( $posttime );
}

Now your template tags ( get_the_date() and the_date() ) echo or return your Arabic Date.

If you want to use it in a template, just call echo ArabicDate() for the current time, or echo ArabicDate( $timestamp ) for any Arabic Date.

Related Posts:

  1. What is the difference between the .po .mo and .pot localization files?
  2. How to make a text with hyperlink translatable in WordPress?
  3. What’s the point on gettext syntax?
  4. Translate a string to a language with masculin/feminine nouns
  5. Change locale manually at runtime?
  6. Text Domains Across Multiple Plugins & Themes
  7. Can we load “load_theme_textdomain” multiple times with different domains?
  8. Where are the official i18n WordPress versions stored (SVN)?
  9. localize inline css
  10. Can we use a variable hook for language string?
  11. Locale filter in conjunction with new datepicker localization
  12. How to use is_rtl with my main style.css?
  13. Localizing text from XML files
  14. Localizing strings that come from outside of plugin?
  15. Alphabetical sorting – local language
  16. How to detect if text domain is already loaded?
  17. does a translation (i18n) have to start from an english PO?
  18. Can’t translate the post meta data (Date) in another language
  19. _n() Single and Plural for search results?
  20. __() with sprintf returns untranslated string
  21. How to add i18n to a plugin’s Twig template files?
  22. load_child_theme_textdomain doesn’t work in function.php
  23. How to prepare SimplePie_Item’s get_date() for l10n?
  24. The effect of x() family of functions
  25. How to translate multi-line strings?
  26. get_locale() behaving strange in same functions.php file
  27. Do I need the .po file for my plugin?
  28. WordPress theme with frontend in different language than backend?
  29. Change WordPress Language
  30. Strings including html for localisation
  31. What does the underscore translate function do in my code without a textdoman
  32. Is it possible to set a different frontend- and backend-language?
  33. Possibility to use WordPress built-in localization
  34. Can any users change locale language?
  35. Localized version offers upgrade to en-us version
  36. Local WordPress installs don’t verfiy against wp-cli checksum check and how to fix that issue.
  37. Loading custom language file for plugin
  38. sprintf bloginfo odditie
  39. Unable to find where to translate certain tooltip string
  40. WP core emails translated
  41. How to translate theme content using site language?
  42. How can i localized html or php source code from wordpress [closed]
  43. Setting frontend locale based on postmeta not loading translation
  44. Using esc_attr function
  45. Change WordPress language based on user setting
  46. Define locale WordPress uses with gettext functions?
  47. Site does not display translations
  48. Theme doesn’t want to load localization files
  49. User specified Timezone
  50. Plugin translation ready – mo file not loaded
  51. Problem with adding a new post type
  52. Do I have to use load_plugin_textdomain() or is there any default folder for languages?
  53. Get localized user roles
  54. Internationalization of strings with html tags and numbers in WordPress
  55. failed to open stream: Permission denied warning while load_textdomain
  56. Requiring Once into plugin PHP File not working
  57. Where does the locale come from?
  58. When localizing a theme do I create the .mo and .po
  59. Localization Problem: Doesn’t Display Translated Words
  60. wordpress localization extending
  61. How to localize built-in strings in a future-proof manner?
  62. Is there some ways to autofix the mo or po files instantly?
  63. I want to dynamically create i18n ecosystem in WordPress
  64. Language string not detecting used within the function
  65. Why does my WordPress Upgrade version have a language suffix?
  66. How to disable gettext feature?
  67. WordPress in French Language [closed]
  68. gettext localization is not working
  69. How do I make this plugin translation-ready?
  70. how to use a default MO file
  71. Localization of menu items
  72. Warning: The actual loaded translation content contains mixed textdomains and is not pure translateable within one textdomain
  73. Is it wrong to use the English version of WordPress to server a site in a different language?
  74. Hack nav menu to add gettext() to menu items?
  75. WordPress NavXT plugin localization
  76. Why is setlocale() returning false on WPEngine?
  77. WordPress emails translate to French
  78. How to create some sort of word mapping?
  79. Is this really always bad? (variables in l10n functions)
  80. How to change text depending on the country
  81. How to dynamically change the locale?
  82. How to show the front end in a different language? I am using the twentytwentythree theme
  83. i18n: How do I load translations for a language specified in the request?
  84. get_post_custom()
  85. Custom Post Status Transition Issues With Get Post Meta
  86. delete post meta from db, even if does not exist?
  87. How to wrap meta values seperated by comma in ? [closed]
  88. How to display singular form of category name?
  89. How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
  90. how to make members list directory through wordpress post custom meta key.
  91. Like & Dislike functionality using JavaScript
  92. How to remove Date from Meta Description on SERP?
  93. wp_query not resetting, last post hanging
  94. How to display childrens custom fields?
  95. Returning a custom content types with meta values
  96. Gravity Forms Update post meta from template [closed]
  97. Remove Meta-boxes (Yoast SEO plugin) [duplicate]
  98. Plug-in for reserving rooms or equipment via corporate intranet
  99. Adding Custom Metadata to my Archive/Posts page
  100. Query against multiple locations within single custom post type post
Categories localization Tags calendar, localization, post-meta
Removed custom post type archive page shows blog page
Requiring login for specific pages

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress