Change language

PHP Jddayofweek () Function

Syntax:
jddayofweek ($jd, $mode)
Parameters:The function takes two parameters as shown above and described below.
  • $jd- it is a required parameter and specifies the Julian day number as an integer. The Gregorian calendar date is converted to a Julian integer using gregoriantojd ($month, $day, $to year).
  • $mode- it is an optional parameter that specifies the type of the return value. It takes a value in the range 0-2 inclusive. The default is 0. The three types of return mode are described below:
    • 0- if the mode is set to 0, it returns 0, 1, 2, 3 & # 8230;, denoting Sunday, Monday, Tuesday & # 8230; respectively as a day of the week. This is the default for the mode when none of the mode parameters are missing or any value is out of range.
    • 1- When mode is passed as 1, it returns Sunday, Monday, Tuesday ...
    • 2- When the mode is set to 2, the abbreviation form MSunday, Monday, Tuesday as Sun, Monday, Tue is returned.
  • Return value: the function returns the day of the week depending on the value of the mode passed in the argument, as described above.Examples:
    Input: $jd = 4/27/2018, mode = 0 Output : 5 Input: $jd = 4/27/2018, mode = 1 Output: Friday
    The programs below illustrate the jddayofweek() function Program 1:The program below shows the output when the mode fails and the default mode is selected.
    // PHP demo program
    // using the jddayofweek() function
    // when the second parameter is not passed 
    // converts the date to a Julian integer $jd = gregoriantojd (4, 27, 2018);  
    // prints the day with the specified date echo jddayofweek ( $jd ); ?>
    Output:
    5
    Program 2:The program below shows the output when the mode is 1.
    // PHP demo program
    // using the jddayofweek() function // when mode 1 
    // converts the date to a Julian integer $jd = gregoriantojd (4, 27, 2018) ;  
    // prints the day with the specified date echo jddayofweek ( $jd , 1); ?>
    Output:
    Friday
    Program 3:The program below shows the output when the mode is 2.
    // PHP demo program
    // using the jddayofweek() function // when mode 2 
    // converts the date to a Julian integer $jd = gregoriantojd (4, 27, 2018) ;  
    // prints the day with the specified date echo jddayofweek ( $jd , 2); ?>
    Output:
    Fri
    Program 4:The program below shows the output when the mode is out of range.
    // PHP demo program
    // using the jddayofweek() function // when the mode is out of range 
    // converts the date to a Julian integer $jd = gregoriantojd (4, 27, 2018);  
    // prints the day with the specified date echo jddayofweek ( $jd , 4); ?>
    Output:
    5
    Link:
    http://php.net/manual/ en / function.jddayofweek.php

    Shop

    Learn programming in R: courses

    $

    Best Python online courses for 2022

    $

    Best laptop for Fortnite

    $

    Best laptop for Excel

    $

    Best laptop for Solidworks

    $

    Best laptop for Roblox

    $

    Best computer for crypto mining

    $

    Best laptop for Sims 4

    $

    Latest questions

    NUMPYNUMPY

    Common xlabel/ylabel for matplotlib subplots

    12 answers

    NUMPYNUMPY

    How to specify multiple return types using type-hints

    12 answers

    NUMPYNUMPY

    Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

    12 answers

    NUMPYNUMPY

    Flake8: Ignore specific warning for entire file

    12 answers

    NUMPYNUMPY

    glob exclude pattern

    12 answers

    NUMPYNUMPY

    How to avoid HTTP error 429 (Too Many Requests) python

    12 answers

    NUMPYNUMPY

    Python CSV error: line contains NULL byte

    12 answers

    NUMPYNUMPY

    csv.Error: iterator should return strings, not bytes

    12 answers


    Wiki

    Python | How to copy data from one Excel sheet to another

    Common xlabel/ylabel for matplotlib subplots

    Check if one list is a subset of another in Python

    sin

    How to specify multiple return types using type-hints

    exp

    Printing words vertically in Python

    exp

    Python Extract words from a given string

    Cyclic redundancy check in Python

    Finding mean, median, mode in Python without libraries

    cos

    Python add suffix / add prefix to strings in a list

    Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

    Python - Move item to the end of the list

    Python - Print list vertically