Page 1 of 1

DateAndTimeA - 64 Bit signed date handling

Posted: Fri Dec 12, 2014 9:29 pm
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

Re: DateAndTimeA - 64 Bit signed date handling

Posted: Fri Dec 12, 2014 10:39 pm
by davido
@es_91,

Link seems to be broken.

Re: DateAndTimeA - 64 Bit signed date handling

Posted: Fri Dec 12, 2014 10:54 pm
by IdeasVacuum
...nice farm though. 8)

Re: DateAndTimeA - 64 Bit signed date handling

Posted: Fri Dec 12, 2014 11:08 pm
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:

Re: DateAndTimeA - 64 Bit signed date handling

Posted: Sat Dec 13, 2014 1:32 am
by IdeasVacuum
line 377 "For" does not support quad variables

Re: DateAndTimeA - 64 Bit signed date handling

Posted: Sat Dec 13, 2014 2:02 am
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?)

Re: DateAndTimeA - 64 Bit signed date handling

Posted: Sat Dec 13, 2014 2:10 am
by IdeasVacuum
Looking good - tried it on Win8.1 x64 PB 5.22LTS

Re: DateAndTimeA - 64 Bit signed date handling

Posted: Sat Dec 13, 2014 5:14 am
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!