PhpDig.net

What is PhpDig?
PhpDig is a PHP MySQL based
Web Spider & Search Engine.




jdtojulian

Name

jdtojulian — Converts a Julian day count to a Julian calendar date.

Synopsis

string jdtojulian(JD);
int JD: Julian day count

Returns

Julian calendar date; 0/0/0 if JD is an invalid Julian day count

Description

jdtojulian() converts a Julian day count to a Julian calendar date. The format of the date string is MM/DD/YY.

Note

The Julian calendar (not to be confused with Julian day count) was adopted by the Roman empire in 46 B.C. The calendar marked a significant change from the earlier Roman calendar systems and it's speculated that it's based on the calendar of another culture - perhaps Babylon. This calendar was adopted by much of the western world and remained in use in some areas until the 20th century. To find out more on this subject, consult your local library or search for Julian calendar on the Internet.

Version

PHP Version: 3+, 4+

See also

To convert a Julian day count to a Julian calendar date:

juliantojd()

To get a Julian day count from another calendar system, see the various *tojd() functions.

Example

Example 78. Display the Julian calendar date for a given Julian day count

$julian_day  = 1000000;
list (, $day, $year) = explode ('/', jdtojulian ($julian_day));
$month = jdmonthname ($julian_day, 3);

// If the year is negative, then it is a BC year
$year = ($year < 0) ? abs ($year) . ' BC' : "$year AD";

echo "$day $month $year";



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.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.