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

Number 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

The gregorian weekday as either an integer or string.

Examples

julian_day

<?

$julian_day = unixtojd();

$return = jddayofweek($julian_day);

echo $return;

?>
4

mode | CAL_DOW_DAYNO

<?

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

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

echo $return;

?>
4

mode | CAL_DOW_LONG

<?

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

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

echo $return;

?>
Thursday

mode | CAL_DOW_SHORT

<?

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

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

echo $return;

?>
Thu

PHP

Home Menu