03-01-2023, 01:56 AM
(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:
- http://www.cpearson.com/excel/datetime.htm
- https://www.ablebits.com/office-addins-b...functions/
- https://www.goskills.com/Excel/Resources...-functions
- https://www.excelfunctions.net/excel-dat...tions.html
- https://www.automateexcel.com/vba/date-functions/
- https://bettersolutions.com/vba/dates-ti...ctions.htm
- https://support.microsoft.com/en-us/offi...4152f97b81
and Javascript:
- https://www.skypack.dev/blog/2021/02/the...libraries/
- https://medium.com/javascript-dots/4-bes...158fd0b9e7
- https://date-fns.org/
- https://momentjs.com/
- https://moment.github.io/luxon/#/
That's all I have for now!