The jddayofweek() function returns the day of the week.
PHP jddayofweek() Function has the following syntax
jddayofweek(jd,mode);
Parameter | Is Required | Description |
---|---|---|
jd | Required. | A Julian Day number |
mode | Optional. | Specifies how to return the weekday. |
mode can have one of the following values:
Value | Description |
---|---|
0 | Default. Returns the weekday as an integer (0=Sunday, 1=Monday, etc.) |
1 | Returns the weekday as a string (Sunday, Monday, etc.) |
2 | Returns the weekday as a string, abbreviated form (Sun, Mon, etc.) |
PHP jddayofweek() Function returns the Gregorian weekday as a string or integer (depends on the mode parameter).
Return the weekday of 21th January, 2013:
<?php
$jd=gregoriantojd(1,21,2013);
echo jddayofweek($jd,1);
?>
The code above generates the following result.