Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Lenny on April 06, 2004, 10:35 PM

Title: Unix Time format
Post by: Lenny on April 06, 2004, 10:35 PM
Is there an API call or vb function that can retrieve the Unix Time?

I've only found c++ libraries that have it available...
Title: Re:Unix Time format
Post by: Noodlez on April 07, 2004, 12:11 AM
You can use the Format() function.
Example:

Format$(MyTime,"hh:mm:ss")
Title: Re:Unix Time format
Post by: Lenny on April 07, 2004, 12:26 AM
Unix time is the number seconds since Jan 1st, 1970 Midnight
Title: Re:Unix Time format
Post by: Noodlez on April 07, 2004, 12:44 AM
Oh, gah. WebBot requires that time (IIRC). You have to write your own function for it.
Title: Re:Unix Time format
Post by: 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
Title: Re:Unix Time format
Post by: iago on April 07, 2004, 11:40 AM
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.
Title: Re:Unix Time format
Post by: dxoigmn on April 07, 2004, 12:00 PM
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)
Title: Re:Unix Time format
Post by: Lenny on April 07, 2004, 10:23 PM
Thanks, I didnt know there was such a vb function...
Title: Re:Unix Time format
Post by: CMallette on April 12, 2004, 06:08 PM
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.