jddayofweekNamejddayofweek — Gets the day of the week for the Gregorian calendar from the given Julian day count.Descriptionjddayofweek() finds the day of the week for the Gregorian calendar date that corresponds to the specified Julian day count. The day of the week is returned as an integer or as the full or abbreviated name of the day. The flag parameter controls the format in which the day of the week is output. If the flag argument is not set, flag is 0. The flags are described in the following table.
NoteYou may be wondering, if the default value for flag is 0, how the caller can tell the difference between an error and Sunday. The user uses the strict comparison operator (===); however, the function doesn't return FALSE on error. This function is poorly designed and only indicates that an error has occurred if the user doesn't give the function an argument. In this case, NULL is returned and a warning is generated. ExampleExample 73. Find out on which days Christmas and New Year's Day fall $year = date ('Y'); // Find the current year $xmas = gregoriantojd (12, 25, $year); $new_years = gregoriantojd (1, 1, $year + 1); echo 'Christmas is on a ', jddayofweek( $xmas, 1); echo ' and New Year\'s Day is on a ', jddayofweek( $new_years, 1) . '.';
PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing
(Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch).
This material may be distributed only subject to the terms and conditions set forth
in the Open Publication License, v1.0 or later (the latest version is presently available at
http://www.opencontent.org/openpub/).
The authors of this book have elected not to choose any options under the OPL. This online book was obtained
from http://www.fooassociates.com/phpfer/
and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4
for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All
persons and entities shall have neither liability nor responsibility to any person or entity with respect to
any loss or damage arising from the information contained in this book.
|