Re: PersianComputing Digest, Vol 21, Issue 6 (fwd)

2005-02-25 Thread Behdad Esfahbod
On Fri, 25 Feb 2005, Skip Tavakkolian wrote:

 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.

The UNIX epoch can easily defined as the number of seconds since
11 Dey 1348.  The important data is a date in the sense of a
point in the axis of time.  How you write it out, depends on one
speific representation though.

--behdad
http://behdad.org/
___
PersianComputing mailing list
PersianComputing@lists.sharif.edu
http://lists.sharif.edu/mailman/listinfo/persiancomputing


Re: PersianComputing Digest, Vol 21, Issue 6 (fwd)

2005-02-24 Thread Behdad Esfahbod
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/
___
PersianComputing mailing list
PersianComputing@lists.sharif.edu
http://lists.sharif.edu/mailman/listinfo/persiancomputing


Re: PersianComputing Digest, Vol 21, Issue 6 (fwd)

2005-02-24 Thread Skip Tavakkolian
 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
PersianComputing@lists.sharif.edu
http://lists.sharif.edu/mailman/listinfo/persiancomputing


Re: PersianComputing Digest, Vol 21, Issue 6 (fwd)

2005-02-22 Thread mohsen ali momeni
 Hi ,

 I talked to Roozbeh Pournader about your mail.  Seems like you
 are using an old version of the code, which has the problem as
 you mentioned.  Our latest code is available from address below
 and doesn't have that problem:

 http://www.farsiweb.info/jalali/jalali.c

Thanks for your attention.
I will apply this new algorithm now and will send a patch again to
mysql in the hope they accept it.

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
___
PersianComputing mailing list
PersianComputing@lists.sharif.edu
http://lists.sharif.edu/mailman/listinfo/persiancomputing


Re: PersianComputing Digest, Vol 21, Issue 6

2005-02-19 Thread Behdad Esfahbod
On Sat, 19 Feb 2005, mohsen ali momeni wrote:

  No.  Wrong.

 So you say we should still fight about our calender name?

I mean yes, if we have not come up with a name yet, we can
continue discussion, of course you are free to call it fight or
whatever.

  No.  They simply are not interested in your functions.

 They were interested, as their first email showed that. They accept it
 but i got no answer after that.

Then your implemention has been poor.

  Again no.  Calendars does not belong to databases.

 I didn't say they belong to databases but having calender functions in
 mysql will make these calcultions much faster in programs instead of
 doing them in php.

No.  A C module for PHP is as fast, if not faster, than doing
them in MySQL, which is apparently the wrongest place you can
implement them.  What about in the kernel then?  Faster?


--behdad
http://behdad.org/
___
PersianComputing mailing list
PersianComputing@lists.sharif.edu
http://lists.sharif.edu/mailman/listinfo/persiancomputing