Home  >  Article  >  Backend Development  >  JDDayOfWeek() function in PHP

JDDayOfWeek() function in PHP

PHPz
PHPzforward
2023-09-16 18:05:041240browse

JDDayOfWeek() function in PHP

The JDDayOfWeek() function returns the day of the week.

Syntax

jddayofweek(julian_day, mode)

Parameters

  • julian_day - Julian day number.

  • Pattern - Specifies the weekly pattern. Possible values:

    • 0 - Default value. Returns the day of the week as an integer (0=Sunday, 1=Monday, etc.)

    • 1 - Returns the day of the week as a string (Sunday, Monday, etc.)

    • 1 - Returns the day of the week (Sunday, Monday, etc.) as a string p>

    • 2 - Returns the weekday as a string, in abbreviated form (Sun, Monday, etc.) Mon, Tue, etc.)

  • Return

    The JDDayOfWeek() function returns the day of the week in the form of a string or integer.

    Example

    The following is an example-

    Live demonstration

    <?php
       $res = gregoriantojd(5,8,2018);
       echo jddayofweek($res,1);
    ?>

    Output

    The following is the output-

    Tuesday

The above is the detailed content of JDDayOfWeek() function in PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete