PHP jddayofweek()Functions

PHP Calendar 参考手册PHP Calendar Reference Manual

Examples

Returns what day of the week January 13, 1998 is:

<?php
$jd=gregoriantojd(1,13,1998);
echo jddayofweek($jd,1);
?>

Run example »

Definition and Usage

The jddayofweek() function returns what day of the week a date is.

Syntax

jddayofweek(jd,mode);

Parameters Description
jd Required. A number (Julian day count).
mode Optional. Defines how to return the day of the week (number or string). Can be one of the following values:
  • 0 - Default. Returns the day of the week as an integer. (0 for Sunday, 1 for Monday, ... and so on)
  • 1 - Returns the day of the week as a string. (Sunday, Monday, ...)
  • 2 - Returns the day of the week as a string, abbreviated form. (Sun, Mon, ...)

Technical Details

Return value: A string or integer (depending onmodethe parameter) returns the day of the week in Gregorian calendar representation.
PHP Version: 4+


PHP Calendar 参考手册PHP Calendar Reference Manual Other Extensions