> On Wed, 23 Feb 2005, mohsen ali momeni wrote:
>> Now something else ,
>> For AddDate and DateDiff functions, I need an algorithm which
>> calculates the number of leap years between two given Date. Is there
>> any such algorithm or at least a documentation for the above
>> algorithms (jalali.c) so that i can find it in the code myself? (Or
>> AddDate, DateDiff functions ready in ideal case)
>> Regards,
>> Mohsen A. Momeni
> Well, that's why I'm saying your implementation is not what MySQL
> people expect.  The date data type is representation-agnostic
> itself, and AddDate, DateDiff, etc work with the date data type
> (at least in MySQL).  What you need is functions to covert from
> internal date representation to Iranian calendar string, and vice
> versa.  You don't need (and should not) implement all date
> functions again.
> --behdad
> http://behdad.org/

I'm not sure how the date data type can be representation agnostic.
What ever the OS provides (via a system call) is in reference to a
starting point in some calendar.  On UNIX systems, this is
traditionally the number of seconds since January 1, 1970, i.e.
Gregorian.  GetSystemTime on Win32 returns a structure, which
represents the Gregorian date.

PersianComputing mailing list

Reply via email to