Re: Programming a calendar system
From: | Carsten Becker <post@...> |
Date: | Saturday, May 15, 2004, 16:23 |
Hello!
From: "Mark J. Reed" <markjreed@...>
Sent: Saturday, May 15, 2004 1:37 AM
Subject: Re: Programming a calendar system
> On Fri, May 14, 2004 at 07:21:36AM -0400, Carsten Becker @ school
wrote:
> > So if you do $value = gregoriantojd(01,01,1970), $value is
> > 2,440,588.
>
> Ugh, one more thing to dislike about PHP. That should be
(1970,01,01);
> is (03,04,1970) March 4th or April 3rd? But I don't seem to have such
> a function in my php (PHP 5.0.0RC1).
Official PHP manual writes:
Description:
int gregoriantojd ( int month, int day, int year)
You've got PHP 5?! I didn't know it's already been released. I'm still
using 4.3.0, because my server only uses 4.3.1.
> Anyway, that function gives you the JD as of noon UTC on that date.
All you
> need to do is convert the UTC time of day to a fraction and adjust by
that.
>
> For example, today is May 14, 2004, which PHP will tell you is
> 2,453,140. Right now as I type this it's 7:25 PM Eastern time.
> [snip maths]
> So the current JD is 2,453,140.475 (always round down when dealing
with
> time).
I see.
-- Carsten
=========================
Class test: Si on pouvait apprendre le français en dormant, ...
I wrote: ... des générations d'élèves ne se revailleraient plus.
My website: http://www.beckerscarsten.de/
My portfolio: http://gitarrenklampfer.deviantart.com/gallery/