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 a given 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 on mode Returns the day of the week in the Gregorian calendar as represented by the parameter.
PHP Version: 4+