Some date functions supporting also dates prior to 1970

Share your advanced PureBasic knowledge/code with the community.
BarryG
Addict
Addict
Posts: 4128
Joined: Thu Apr 18, 2019 8:17 am

Re: Some date functions supporting also dates prior to 1970

Post by BarryG »

Thanks, I'll check it out again. There was a post by you there that said it was obsolete, so I ignored it before. Is that no longer the case?
User avatar
mk-soft
Always Here
Always Here
Posts: 6206
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Some date functions supporting also dates prior to 1970

Post by mk-soft »

With the introduction of C-Backend, probably no more.
Remember that the date values are in UTC. This is important for logging, databases and sorting. That's why I decided to use UTC. Double because of the milliseconds. The decimal places are the milliseconds and the pre-decimal places are the seconds since 1970.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: Some date functions supporting also dates prior to 1970

Post by Andre »

BarryG wrote: Sun May 21, 2023 2:40 am This Date module is great, but it doesn't compile with the C backend because it uses ASM. Is there an alternative Date module that doesn't use ASM so I can compile my app with the C backend? Thanks!
I just stumbled across the same problem. Because of the used ASM in this module I can't compile my whole project with the C-backend.... :?
There is no easy way to have it adapted for use with this backend (using CompilerIf variants of the current code for ASM, and a C-backend compatible version of the Date64() and Date64Info() procedures currently made with ASM code)?

(And I admit that I saw the newer module from mk-soft, but due to my very limited time I wasn't able to delve deeper into it and the necessary reprogramming of my project.... :oops:)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Some date functions supporting also dates prior to 1970

Post by Little John »

@André

DateEx:
  • runs with ASM and C backend
  • works fine on Windows and Linux
  • on Mac OS, functions for current local time and UTC are missing
User avatar
mk-soft
Always Here
Always Here
Posts: 6206
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Some date functions supporting also dates prior to 1970

Post by mk-soft »

My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
the.weavster
Addict
Addict
Posts: 1576
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: Some date functions supporting also dates prior to 1970

Post by the.weavster »

Don't overlook the fact SQLite's date functions are available to you :wink:
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: Some date functions supporting also dates prior to 1970

Post by Andre »

Thanks LittleJohn and mk-soft for your modules, I have both stored for later usage :-)

Because of my needs (switching between data values and strings, get/set the date in a CalenderGadget, be compatible with Windows and MacOS) I've now used the DateTime module (mk-soft) and could easily switch from the functions of the Date64 module (this topic) to the new one. Thank you :D
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Post Reply