[Resolved] How to convert a post’s date/year from Gregorian calendar to Hebrew calendar?
For a project I’m working on, we wish to convert the date of posts within a single category from the Gregorian calendar year (2009, for example) to the Hebrew calendar year (5769, in this case).
Does anyone know how to do this? I found the PHP snippet below, but have no idea how to call it within WordPress so that it would convert the date output with a post to read in the Hebrew year.
Any & all help is appreciated!
Sample code snippet that seems to do what we’re looking for:
<?php $gregorianMonth = date(n); $gregorianDay = date(j); $gregorianYear = date(Y); $jdDate = gregoriantojd($gregorianMonth,$gregorianDay,$gregorianYear); $hebrewMonthName = jdmonthname($jdDate,4); $hebrewDate = jdtojewish($jdDate); list($hebrewMonth, $hebrewDay, $hebrewYear) = split('/',$hebrewDate); echo "$hebrewDay $hebrewMonthName $hebrewYear"; ?>
- The topic ‘[Resolved] How to convert a post’s date/year from Gregorian calendar to Hebrew calendar?’ is closed to new replies.