Since it looks like UserLoser has this done wrong in his WebChannel client, I figured I'd post the correct calculation here.
Hex(21600 + 3600 * Hour(Now) + 60 * Minute(Now) + Second(Now))
(converted to hex per to WebChannel specification)
is "now" a variable or a function? If it's a function, you should store it in a variable and use the variable in place of "now". :-)
Hehe, thanks also ;)
Now returns the current system date and time i.e.: 9/30/2003 3:41:07 PM
But it's probably a function, not a variable, so calling it many times is baad! :)
Actually it's very bad, in case the value changes between two calls. If you get the hour from 12:00:00 and the other data from 11:59:59, you'll be off....
Also, ctime? What's that? I thought ctime was a string representation of a time_t..
Quote from: Adron on October 02, 2003, 03:31 PMAlso, ctime? What's that? I thought ctime was a string representation of a time_t..
It is! I think there was a documentation error. What should have been written was the time(2) format (as opposed to GetTickCount (), GetSystemTime (), or other Windows specific time specifiers (yes, I know GTC would be horribly inappropriate even if you did want something Windows specific)).
That's supposed to be seconds since 1970 though? How is that ever going to work out if you only pass in hour, minute and second??
Quote from: Adron on October 02, 2003, 05:16 PM
That's supposed to be seconds since 1970 though? How is that ever going to work out if you only pass in hour, minute and second??
He is taking advantage of the fact that the current BinaryChatISAPI implementation only uses the ctime provided as a
timestamp. Eventually,
datestamping may be introduced, in which case this code will not work at all.
Quote from: Skywing on October 02, 2003, 10:05 PM
Quote from: Adron on October 02, 2003, 05:16 PM
That's supposed to be seconds since 1970 though? How is that ever going to work out if you only pass in hour, minute and second??
He is taking advantage of the fact that the current BinaryChatISAPI implementation only uses the ctime provided as a timestamp. Eventually, datestamping may be introduced, in which case this code will not work at all.
Neat. When are you planning on adding this so I can get a head-start with future releases of WebBot?