Virtual Pascal

Classic Object Pascal for free

Hi, everyone.

I'm writing an amateur radio logging program for myself and I'm wondering how to properly store the date and time for each record so I can easily have the program sort by date or time.  This is something I've never really tackled before.  I've used a UNIX timestamp unit under DOS for my BBS doors but not anything like what I'm wanting to do here.

The rest of the program is pretty easy to write but for some reason I ran into a stumbling block with this.

Views: 182

Reply to This

Replies to This Discussion

ISO-8601? YYYY-MM-DDThh:mm:ss

I guess what I meant to say was this: does Virtual Pascal have an internal format for storing this information in a single variable or do I just declare a string and manually write the date and time to it?  I have to have two timestamps (one for the start of a contact and one for the end) and am just trying to figure out the best way to store the information.  I'm going back to programming after a few years' absence so I'm having to relearn all over again.

Usually in Delphi and alike dialects, TDatetime is used. Internally that is a double with the (julian, days after epoch=1899-12-30(*)) date as integer part, and the time as fractional part, giving a 50ms resolution or something like that.

The only problem is that it doesn't model timezone.

sysutils and dateutils are the units that work with it. See what VP has, and port the rest from FPC.

(*) 1900-1-1 corrected for a leapyear glitch to keep it in sync with an old excel glitch that assumed 1900 was a leap year

That's what I'm wanting to do.  I'm trying to learn how to properly store the date and time and then to be able to properly sort by date.  Appreciate all the help from everyone!

I've decided to just use UNIX timestamps.  They're a lot easier to work with for me.


© 2022   Created by Allan Mertner.   Powered by

Report an Issue  |  Terms of Service