Unix timestamp fun

Everything else that doesn't fall into one of the other PB categories.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Unix timestamp fun

Post by Karbon »

Has anyone done any leg work on getting and manipulating UNIX-style timestamps in PB?

I ask only because I'm going to be using SQLite as a database back-end (I think) but it doesn't have any internal date or time functions and since it's typless the only option I have for storing a time value is in the UNIX way (seconds since January 1, 1970). I've looked through all the API docs I can get my hands on and haven't found any internal functions for getting or dealing with timestamps..

Any help appreciated! Thanks!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

The PureBasic Date library works the unix way, seconds since jan 1 1970

The maximum date supported is December 31, 2037 23:59:00 if using 32 bit under unix.

Code: Select all

d = Date(1970, 1, 1, 0, 0, 0)
Debug d

d = Date(2037,12,31,23,59,59) 
Debug d 

Debug Year(d)
Debug Month(d)
Debug Day(d)
Debug Hour(d)
Debug Minute(d)
Debug Second(d)
Post Reply