date type?
#6
(02-28-2023, 07:50 PM)TerryRitchie Wrote:
(02-28-2023, 08:14 AM)madscijr Wrote: Do we have a native date/time type, with all the associated functions (dateadd, datediff, date to UNIX epoch & vice-versa, timezone operations, etc.) or has anyone built an equivalent library in QB64PE or related?

Back in the early 90's I had to write many of these date functions for a drug testing program I wrote for my local municipality. If I remember correctly most were fairly easy to calculate, except for Easter, which uses a convoluted equation.

With a little Internet research these should be fairly easy to find written in other source code and converted to QB64. I'll add it to my list of libraries to create but won't be able to get to it for some time as I'm working on others right now.

That would be great - I'm not working on anything where I need date calculations right now, 
I just think this kind of thing would be very useful (especially for business apps). 

A number of years back I worked on a big JavaScript library where we needed all kinds of date conversion, formatting, validation, and calculations, and we ended up with close to 50 functions, and there was still tons more to do. The basic functions aren't too hard to roll on your own, it's just that when you consider things like time zones and leap years and business days and so on, the list quickly grows! Then date libraries like moment.js started appearing and it became apparent that we could stop being in the date/time business, lol. 

Mainly the ones I use in apps like Excel, Outlook VBA, etc., are DATEDIFF, DATEADD, CDATE, comparisons, and formatting. 

But you can see here just how deep you can go! 

On the Microsoft side:
and Javascript:
That's all I have for now!
Reply


Messages In This Thread
date type? - by madscijr - 02-28-2023, 08:14 AM
RE: date type? - by mnrvovrfc - 02-28-2023, 09:21 AM
RE: date type? - by madscijr - 02-28-2023, 01:04 PM
RE: date type? - by mnrvovrfc - 02-28-2023, 02:22 PM
RE: date type? - by TerryRitchie - 02-28-2023, 07:50 PM
RE: date type? - by madscijr - 03-01-2023, 01:56 AM
RE: date type? - by mnrvovrfc - 03-01-2023, 03:37 AM
RE: date type? - by SMcNeill - 03-01-2023, 09:58 AM
RE: date type? - by bplus - 03-01-2023, 04:05 PM
RE: date type? - by madscijr - 03-01-2023, 05:29 PM
RE: date type? - by mnrvovrfc - 03-01-2023, 10:11 PM
RE: date type? - by SpriggsySpriggs - 03-01-2023, 02:40 PM
RE: date type? - by madscijr - 03-01-2023, 03:27 PM
RE: date type? - by mnrvovrfc - 03-01-2023, 04:16 PM
RE: date type? - by SpriggsySpriggs - 03-01-2023, 04:31 PM
RE: date type? - by Kernelpanic - 03-01-2023, 06:31 PM
RE: date type? - by TerryRitchie - 03-01-2023, 06:55 PM
RE: date type? - by madscijr - 03-01-2023, 09:18 PM
RE: date type? - by SMcNeill - 03-02-2023, 02:23 AM
RE: date type? - by bplus - 03-02-2023, 02:35 AM
RE: date type? - by madscijr - 03-02-2023, 06:48 PM



Users browsing this thread: 9 Guest(s)