jddayofweek(): getting week day

Get the weekday from a Julian Day count

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.

We can get day of the week in different formats by using jddayofweek function. This function takes Julian day number as integer and returns the day . Here is the syntax
jddayofweek(Julian_day_numnber, mode )
As we have used default format so the function will return 0 for Sunday , 1 for Monday ...
If we change the format like this
\ = jddayofweek(\,1);
The output will be Saturday
\ = jddayofweek(\,2);
The output will be Sat

Example 2: Getting the Day as a String

Use jddayofweek() to return the name of the day:

\ = gregoriantojd(9, 18, 2024); 
echo jddayofweek(\, 1); // Outputs: Wednesday

Example 3: Getting the Numeric Day of the Week

\ = 2459583;
echo jddayofweek(\, 0); // Outputs: 1

Calendar Functions Month name from Julian day count


Subscribe to our YouTube Channel here



plus2net.com











PHP video Tutorials
✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer