Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

jddayofweek()

Example

Determine the weekday for January 13, 1998.

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

Definition and Usage

The jddayofweek() function provides the day of the week.

Syntax

jddayofweek(jd,mode);

Parameter Values

 

Parameter

Description

jd

Required. A Julian Day Number.

mode

Optional. Determines the format for returning the weekday. Possible values are:

  • 0 – Default. Returns the weekday as an integer (0=Sunday, 1=Monday, etc.).
  • 1 – Returns the weekday as a full name string (Sunday, Monday, etc.).
  • 2 – Returns the weekday as an abbreviated string (Sun, Mon, etc.).

Technical Details

Return Value:

Returns the Gregorian weekday as either a string or integer, depending on the mode parameter.

PHP Version:

4+