jddayofweek

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

NumberConstantDescription
0CAL_DOW_DAYNOReturn the day number as an int (0=Sunday, 1=Monday, etc)
1CAL_DOW_LONGReturns string containing the day of week (English-Gregorian)
2CAL_DOW_SHORTReturn a string containing the abbreviated day of week (English-Gregorian)

Return

The gregorian weekday as either an integer or string.

Examples

1 · julian_day

<?

$julian_day = unixtojd();

$return = jddayofweek($julian_day);

echo $return;

?>
5

2 · mode · CAL_DOW_DAYNO

<?

$julian_day = unixtojd();
$mode = CAL_DOW_DAYNO;

$return = jddayofweek($julian_day, $mode);

echo $return;

?>
5

3 · mode · CAL_DOW_LONG

<?

$julian_day = unixtojd();
$mode = CAL_DOW_LONG;

$return = jddayofweek($julian_day, $mode);

echo $return;

?>
Friday

4 · mode · CAL_DOW_SHORT

<?

$julian_day = unixtojd();
$mode = CAL_DOW_SHORT;

$return = jddayofweek($julian_day, $mode);

echo $return;

?>
Fri
HomeMenu