ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
Timestamp VB (Sdk)
Timestamp VB // Sdkking small guyApr 8, 2004, 11:58pm
Just wonderin how do i get the timestamp like
1078600281 to be like in the aw browser and im realy confused over it plz help ^_^ ep0chApr 9, 2004, 1:24am
First, you need to devise an offset correction system for the user time.
Once you have an offset timestamp (converted to correct vrt time) you can use the sdk's long2date function: sdk.long2date (timestamp). Hope this helps a little bit. If you need more information just ask. -Ep0ch [View Quote] brantApr 9, 2004, 5:12pm
Visual Basic's "Date" class has a concept of "Ticks," where it counts the
number of 100 nanosecond increments since something like January 1, 0001 CE - even before the gregorian calendar was in use. I'm sure that by dividing by the appropriate number to convert from nanoseconds to seconds and by subtracting the value for January 1, 1970 you could write a class that inherits from the Date class and provides a conversion function to SDK/C++ format. Take a look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatetimeclasstickstopic.asp. It's the more difficult way to do things, but you only have to write it once, and then you use it over and over... [View Quote] |