Use jddayofweek() with mode 1 to receive the weekday name directly.
$jd = gregoriantojd(9, 14, 2026);
echo jddayofweek($jd, 1);Current example first; the detailed examples and demos below are retained for additional learning and comparison.
\ = cal_to_jd(CAL_GREGORIAN,5,4,2013);
\ = jddayofweek(\,0);
echo \;
The output will be 6. jddayofweek(Julian_day_numnber, mode )
As we have used default format so the function will return 0 for Sunday , 1 for Monday ... \ = jddayofweek(\,1);
The output will be Saturday
\ = jddayofweek(\,2);
The output will be Sat
Use jddayofweek() to return the name of the day:
\ = gregoriantojd(9, 18, 2024);
echo jddayofweek(\, 1); // Outputs: Wednesday
\ = 2459583;
echo jddayofweek(\, 0); // Outputs: 1
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.