DateAndTimeA - 64 Bit signed date handling

Share your advanced PureBasic knowledge/code with the community.
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

DateAndTimeA - 64 Bit signed date handling

Post by es_91 »

Moinsen,

this is an include file that allows you to store, calculate with and communicate dates to DateGadgets on Windows, ranging from 1st January 1601 to 31st December 9999.

It is second-based and follows the directives of the Unix Time Stamp, just like PureBasic's Date library does (which is why all possible PB date values are compatible with the functions of this library).

The calculation functions use the SYSTEMTIME structure provided by the WinAPI, of course they are not cross-platform! :(

Thanks for all the help I got from this forum, as well as the friendships made!

Latest version: http://web44.srv2.domainbase24.com/DateAndTimeA.pbi

Updated: 2014-12-13 19:57:14 GMT
Last edited by es_91 on Sat Dec 13, 2014 8:58 pm, edited 14 times in total.
:mrgreen:
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: DateAndTimeA - 64 Bit signed date handling

Post by davido »

@es_91,

Link seems to be broken.
DE AA EB
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: DateAndTimeA - 64 Bit signed date handling

Post by IdeasVacuum »

...nice farm though. 8)
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: DateAndTimeA - 64 Bit signed date handling

Post by es_91 »

It's back up.

Please take a look at it. Would not wonder me if there is still a bug hidden somewhere. :mrgreen:

However, it should be heavily usable. Have funwith it!

Considering the PB bug: I found a workaround. Sorry for the inconveniance!
IdeasVacuum wrote:...nice farm though. 8)
:lol:
:mrgreen:
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: DateAndTimeA - 64 Bit signed date handling

Post by IdeasVacuum »

line 377 "For" does not support quad variables
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: DateAndTimeA - 64 Bit signed date handling

Post by es_91 »

I corrected the code. Thanks for improving! :)

I do not expect anybody to calculate with dates like 245768930 B.C. so the possible 100776 ([9999 - 1601] * 12) months as delta in AddDateA () should dictate the data type for ThisMonth.

I set it to Long. Try now, please.

(Do you use an older version of PureBasic?)
:mrgreen:
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: DateAndTimeA - 64 Bit signed date handling

Post by IdeasVacuum »

Looking good - tried it on Win8.1 x64 PB 5.22LTS
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: DateAndTimeA - 64 Bit signed date handling

Post by es_91 »

Code's been completely overworked. Two new functions have been added:

- SetDateGadgetRangeA ()
- GetDateGadgetRangeA ()

... works similar to the ~GadgetAttribute () functions for DateGadget, however they work with structured variables!
:mrgreen:
Post Reply