HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

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

ValueConstantDescription
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

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