jddayofweek
Description
The jddayofweek of Calendar for PHP returns the day of the week.
Syntax
jddayofweek( int $julian_day, int $mode = CAL_DOW_DAYNO ): int|string
Parameters
julian_day
A julian day number as integer
mode
Value | Constant | Description |
---|---|---|
0 | CAL_DOW_DAYNO | Return the day number as an int (0=Sunday, 1=Monday, etc) |
1 | CAL_DOW_LONG | Returns string containing the day of week (English-Gregorian) |
2 | CAL_DOW_SHORT | Return a string containing the abbreviated day of week (English-Gregorian) |
Return
Returns the gregorian weekday as either an integer or string.
Examples
1 · julian_day
<? $julian_day = unixtojd(); $return = jddayofweek($julian_day); echo $return;
2
2 · mode · CAL_DOW_DAYNO
<? $julian_day = unixtojd(); $mode = CAL_DOW_DAYNO; $return = jddayofweek($julian_day, $mode); echo $return;
2
3 · mode · CAL_DOW_LONG
<? $julian_day = unixtojd(); $mode = CAL_DOW_LONG; $return = jddayofweek($julian_day, $mode); echo $return;
Tuesday
4 · mode · CAL_DOW_SHORT
<? $julian_day = unixtojd(); $mode = CAL_DOW_SHORT; $return = jddayofweek($julian_day, $mode); echo $return;
Tue