Milliseconds since 1970 Function

BlitzMax Forums/BlitzMax Programming/Milliseconds since 1970 Function

Retimer(Posted 2009) [#1]
Millisecs() returns the time that the pc has been turned on, doesn't it?

Is there a function for the 'ms since jan 1st 1970' laying around?


GfK(Posted 2009) [#2]
There's code in the code archives that tells you how many days have passed between two given dates.

Calculating the number of seconds from that would be relatively trivial. Calculating the milliseconds might be an issue as I don't think that even a Long could hold such a value.

[edit] http://www.blitzbasic.com/codearcs/codearcs.php?code=1647


Volker(Posted 2009) [#3]
I'm sure Brucey's DateTime mod covers that.
http://brucey.net/programming/blitz/modules/datetime/datetime.zip


Retimer(Posted 2009) [#4]
Calculating the number of seconds from that would be relatively trivial. Calculating the milliseconds might be an issue as I don't think that even a Long could hold such a value.


Thanks...although a long should have no problem holding that value - but without preicion milliseconds, there'd be no need for anything lower than a second.

I'm sure Brucey's DateTime mod covers that.
http://brucey.net/programming/blitz/modules/datetime/datetime.zip


Yeah I have all bruceys modules :) I tend to download them and forget to check through them to see what other capabilities I can have. It didn't have exactly what I wanted...the 1970 function was there, but only for filetimes. However thanks to built-in non-delimitered return strings with the date system I had no problem scrounging something together.

Thanks folks.


GfK(Posted 2009) [#5]
Thanks...although a long should have no problem holding that value - but without preicion milliseconds, there'd be no need for anything lower than a second.
Well to be fair (to me), you did ask for the result in milliseconds:
Is there a function for the 'ms since jan 1st 1970' laying around?