According to the PB documentation, PB uses UNIX time: http://www.purebasic.com/documentation/date/index.html
This is "the number of seconds elapsed since the 1st of January 1970", so the "supported date/time values are 1970-01-01, 00:00:00 for the minimum and 2038-01-19, 03:14:07 for the maximum".
If you wanted to work with dates before 1970 (e.g. birth dates) or beyond 2038 (e.g. retirement calculations), then you can't use the PB Date library, correct?
However, isn't this a 32-bit limitation? Now that PB supports 64-bits, can the 64 bit version support the almost unlimited date range of 64-bit integers?
References:
http://en.wikipedia.org/wiki/Unix_time
http://www.sqlite.org/lang_datefunc.html
Date library and UNIX time ... 64-bit ?
Re: Date library and UNIX time ... 64-bit ?
You can use some quad-based codes like:
http://www.purebasic.fr/german/viewtopi ... 72#p315072
http://www.purebasic.fr/german/viewtopi ... 63#p207863
i think, you will found some other codes in english
http://www.purebasic.fr/german/viewtopi ... 72#p315072
http://www.purebasic.fr/german/viewtopi ... 63#p207863
i think, you will found some other codes in english
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Re: Date library and UNIX time ... 64-bit ?
Moderator, please move this to Feature Requests.
Thanks
Thanks
Re: Date library and UNIX time ... 64-bit ?
> please move this to Feature Requests
No need. It's been requested before lots of times.
Last example found: http://www.purebasic.fr/english/viewtop ... =3&t=49666
No need. It's been requested before lots of times.
Last example found: http://www.purebasic.fr/english/viewtop ... =3&t=49666
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
-
BorisTheOld
- Enthusiast

- Posts: 542
- Joined: Tue Apr 24, 2012 5:08 pm
- Location: Ontario, Canada
Re: Date library and UNIX time ... 64-bit ?
We get around the problem by using the Date features in PowerBasic and FreeBasic.USCode wrote:If you wanted to work with dates before 1970 (e.g. birth dates) or beyond 2038 (e.g. retirement calculations), then you can't use the PB Date library, correct?
We've created two dynamic libraries -- a PowerBasic DLL for use with Windows, and a FreeBasic SO for use with Linux. They are very small libraries (less than 100 statements each) that give us access to a few low-level features, such as shareable file I/O and date-serial manipulation.
Access to these two libraries is via a small PB wrapper module. The rest of our code is 100% cross-platform PB.
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
~ Spike Milligan
Re: Date library and UNIX time ... 64-bit ?
@USCode
In the meantime you could look at this code by Wilbert:
http://www.purebasic.fr/english/viewtop ... 12#p421612
In the meantime you could look at this code by Wilbert:
http://www.purebasic.fr/english/viewtop ... 12#p421612
DE AA EB
Re: Date library and UNIX time ... 64-bit ?
Thanks guys, but what about the PB date/time related gadgets CalendarGadget and DateGadget?
Using GetGadgetState() and SetGadgetState() on them still limits the allowed date range?
It is surprising this issue still exists, I would think this would be a much higher priority than some other new features that have been added. Isn't this pretty doable with the 64-bit compilers now or is there another limitation? What if you just wanted to develop an application that stored dates in history or birth dates? Maybe it's because Fred was born AFTER 1-JAN-1970 ...
... some of us were born before that date! :-\
Using GetGadgetState() and SetGadgetState() on them still limits the allowed date range?
It is surprising this issue still exists, I would think this would be a much higher priority than some other new features that have been added. Isn't this pretty doable with the 64-bit compilers now or is there another limitation? What if you just wanted to develop an application that stored dates in history or birth dates? Maybe it's because Fred was born AFTER 1-JAN-1970 ...
Re: Date library and UNIX time ... 64-bit ?
> what about the PB date/time related gadgets CalendarGadget and DateGadget?
> Using GetGadgetState() and SetGadgetState() on them still limits the allowed date range?
See Freak's post here: http://www.purebasic.fr/english/viewtop ... 08#p105008
> Isn't this pretty doable with the 64-bit compilers now
Most PCs these days are still only 32-bit. They can't be left out.
> Using GetGadgetState() and SetGadgetState() on them still limits the allowed date range?
See Freak's post here: http://www.purebasic.fr/english/viewtop ... 08#p105008
> Isn't this pretty doable with the 64-bit compilers now
Most PCs these days are still only 32-bit. They can't be left out.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
Re: Date library and UNIX time ... 64-bit ?
Now that PB supports quads it is doable now?
Re: Date library and UNIX time ... 64-bit ?
> Now that PB supports quads it is doable now?
The exact same question remains unanswered here:
http://www.purebasic.fr/english/viewtop ... 21#p370021

The exact same question remains unanswered here:
http://www.purebasic.fr/english/viewtop ... 21#p370021
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.


