• Welcome to Valhalla Legends Archive.
 

Unix Time format

Started by Lenny, April 06, 2004, 10:35 PM

Previous topic - Next topic

Lenny

Is there an API call or vb function that can retrieve the Unix Time?

I've only found c++ libraries that have it available...
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

Noodlez

#1
You can use the Format() function.
Example:

Format$(MyTime,"hh:mm:ss")

Lenny

#2
Unix time is the number seconds since Jan 1st, 1970 Midnight
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

Noodlez

Oh, gah. WebBot requires that time (IIRC). You have to write your own function for it.

Telos

Its something like DateDiff( Now, "s", #1/1/1970# )
The difference in seconds between now and January 1st 1970

iago

What format does "now" return the time as?  If it's nanoseconds since 1700 or whatever, I have a function that will convert that to seconds since 1970 that I can post.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


dxoigmn

Quote from: Telos on April 07, 2004, 07:48 AM
Its something like DateDiff( Now, "s", #1/1/1970# )
The difference in seconds between now and January 1st 1970


DateDiff("s", #1/1/1970#, Now)

Lenny

Thanks, I didnt know there was such a vb function...
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

CMallette

Unix Time is the amount of seconds since Jan 1st, 1970 GMT.

If the computer using DateDiff("s", #1/1/1970#, Now) is not in GMT timezone, the timestamp will be off by some hours.