RE: [PHP-WIN] Help with Calendar Functions!!
| From: | Joey Garcia | Date: | Fri, 10 Nov 2000 17:48:28 +0000 |
| Subject: | RE: [PHP-WIN] Help with Calendar Functions!! | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-3786@lists.php.net to get a copy of this message | ||
WOW!!! This is the information I needed!!!! I really appreciate your
knowledge!!!!! and Help!!!!!!
-----Original Message-----
From: Zak Greant [mailto:zak@php.net]
Sent: Friday, November 10, 2000 10:42 AM
To: Joey Garcia
Cc: php-windows@lists.php.net
Subject: RE: [PHP-WIN] Help with Calendar Functions!!
At 10:23 AM 11/10/00 -0700, you wrote:
>I figured it was a BC date, but why that date? What is the coorelation
>between -4713 and 2000? Would 2001 be -4712? What is the algorithm to
>convert it or how do I use -4713, or whatever BC date, to get the current
>year? What is funny is that how could it come back with a result of 10/28
>(month/day) for Julian Day of 301 when it doesn't know the year? (Leap
>year can throw that off)
Julian Day Counts are not what you think they are. :)
A JD count is the number of days that have elapsed since November 25th, 4714
BC
>I tried your example but that just gave me a result of "2451859", but no
>matter what I do I can't get that to convert to the current year(2000).
>Again, I don't know the correct algorithm, I get either 1999 or 2004
>depending if I use 365 or 365.25.
>
>Can you get a Julian day from a date using these functions?
>
>Example,
>
>For Date: 1/1/2000 the Julian Day: 1
>For Date: 3/1/200 the Julian Day: 61
>etc. ...
To get the number of days cound for the year using JD counts, do something
like this:
list ($m, $d, $y) = explode ('/', date ('m/d/Y'));
$new_years_day = gregoriantojd (1, 1, $y);
$today = gregoriantojd ($m, $d, $y);
print ($today - $new_years_day) + 1;
Or just use
date ('z') :)
>Again, I really appreciate your help!!!
No prob - I have been doing a lot of work with the calendar functions
lately. :)
--zak