I have been looking at the code my self and I think I can rewrite in Pascal, so it fits to the timestamp format. Should I write the code a stand a lone lib and sent it to Frank Heckenbach/Peter Gerwinski or just to the list and then the person that maintains the GPC unit would cut and past it into the unit?
Kind Regards,
Klaus F. Ãstergaard
-----Original Message----- From: Pernille Bech & Klaus F. Ãstergaard [mailto:farremosen@mail.tele.dk] Sent: Monday, March 05, 2001 11:29 PM To: gpc@gnu.de Subject: Sv: Timestamp format and calculations?
I have been looking for a lib with date calculations, and found this C/PERL lib. As I don't know anything about C and how you make C work together with GPC, could some of you please look at the lib to see if it is an easier way to get more functional lib than starting all over in pascal.
http://www.engelschall.com/u/sb/download/
I think this lib contains some nice routines to convert from different date/time notations, also including different languages for text name on dayes, months, converting to and from normal date and business (year week day) format ect.
Hope this can help improve GPC
kind regards, Klaus F. Ãstergaard
----- Original Message ----- From: Frank Heckenbach frank@g-n-u.de To: gpc@gnu.de Sent: Saturday, March 03, 2001 9:00 AM Subject: Re: Timestamp format and calculations?
Eike Lange wrote:
On Mon, Feb 26, 2001 at 07:04:38AM +0100, Frank Heckenbach wrote:
A routine to check a given date (with or without checking DayOfWeek) would be nice, and I might write it someday (too busy right now), but if you have such a routine to contribute, let me know...
We have such in our GLib-Unit, GDateValid(...). Just wait a few days :-)
I looked at it. But it operates on a different type (PGDate). Converting to and from it, and linking glib is probably much more effort than writing the function in Pascal which shouldn't take more than a few lines. (I don't mean to put down the project, but using a set of date/time routines that operate on yet another type (as if there weren't more than enough already) is probably not such a good idea unless one is porting a C program that uses glib already...)
BTW, when I looked at the unit, I saw `function GPOINTER_TO_INT(x : Pointer) : Integer;' at the end. That's very dangerous. If you have to cast between pointers and integers at all for some reason, use PtrInt or PtrCard which is guaranteed to have the same size. On some 64 bit platforms, Integer is still 32 bit and Pointer is 64 bit, so this routine is a sure way to produce invalid addresses. (I don't know if glib uses `int' where it accepts pointers, but if it does, it's not 64 bit safe, either...)
Frank
-- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html
Hi !
On Thu, Mar 08, 2001 at 08:03:28AM +0100, Klaus Friis Ãstergaard wrote:
I have been looking at the code my self and I think I can rewrite in Pascal, so it fits to the timestamp format. Should I write the code a stand a lone lib and sent it to Frank Heckenbach/Peter Gerwinski or just to the list and then the person that maintains the GPC unit would cut and past it into the unit?
IMHO, you should write the unit. We could perhaps improve the unit by conversions of date/time formats, used in special cases like "flight-sheduling". AFAIK do the airports calculate an hour based on 100 "Ticks?" (like swatch-thee-beep :). Maybe, there are some more date/time calculations available for some special purpose.
Eike