31.07.2011, 17:43
Quote:
Thanks iLinx but I am wondering how I use unix timestamps, I have never used them before.
|
Gettime() (without parameters) returns a unix time stamp.
For example, assume you have a variable which stores the time the server started up on, @1312130588. Right now it's 1312137588 when you call the uptime function. The difference is 7000 seconds between the two (when you subtract the current timestamp from the startup timestamp, the current will always be larger so you subtract it first). Once you have the difference its a matter of converting the difference in seconds to a more readable number (ie h,m,s) using the division and modulus operators.