PHP JDDayOfWeek() Function

Example

Return the day of the week for October 15, 1980:

<?php
$jd=gregoriantojd(10,15,1980);
echo jddayofweek($jd,1);
?>

Run Example

Definition and Usage

The jddayofweek() function returns the day of the week for the date.

Syntax

jddayofweek(jd,mode);
Parameter Description
jd Required. Number (Julian day count).
mode

Optional. Defines how to return the day of the week (number or string). It can be one of the following values:

  • 0 - Default. Returns the day of the week as an integer. (0 is Sunday, 1 is Monday... etc.)
  • 1 - Returns the day of the week as a string. (Sunday, Monday, ...)
  • 2 - Returns the day of the week as a string, in abbreviated form. (Sun, Mon, ...)

Technical Details

Return value: As a string or integer (depending mode Parameter)Returns the day of the week in the Gregorian calendar.
PHP Version: 4+