jdtofrenchDescriptionjdtofrench() converts a Julian day count to a French Republican cCalendar date string. The returned date string is formatted as MM/DD/YY. Valid Julian day counts for this function range from2375840 to 2380952. If a count outside this range is specified, the function returns 0/0/0. See alsoTo convert a French Republican Calendar date to a Julian day count: To get a Julian day count from another calendar system, see the various *tojd() functions. ExampleExample 75. Convert a Gregorian date to a textual French Republican Calendar date <?php function gregorian_to_french ($year, $month, $date) { // Define start and end dates for the French Republican Calendar $frc_start = gregoriantojd (9, 22, 1792); $frc_end = gregoriantojd (9, 22, 1806); // Convert date to a Julian day count $date_to_convert = gregoriantojd ($month, $date, $year); // Ensure that the date to be converted is within the start and end dates if ($date_to_convert < $frc_start || $date_to_convert > $frc_end) return FALSE; // Define month names $month_names = array ( 1 => 'Germinal', 2 => 'Floréal', 3 => 'Prairial', 4 => 'Messidor', 5 => 'Thermidor', 6 => 'Fructidor', 7 => 'Vendémiaire', 8 => 'Brumaire', 9 => 'Frimaire', 10 => 'Nivôse', 11 => 'Pluviôse', 12 => 'Ventôse', 13 => 'Complémentaire / Festival de Sans-culottides' ); $frc_date = jdtofrench ($date_to_convert); list ($month, $date, $year) = explode ('/', $frc_date); return "$month_names[$month] $date, $year"; } echo gregorian_to_french (1799, 9, 22); ?>
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.
|