gettime
Description:
Function gettime get the current server time, which will be stored in the variables &hour, &minute and &second.
This function name starts with a lowercase letter. |
This function is useful for measuring time intervals by using its timestamp characteristics. This can be particularly useful if you want to restrict some functionality based on a time (e.g. a command that can only be executed every 30 seconds). Using this method you don't have to rely on timers. |
Parameters:
(&hour = 0, &minute = 0, &second = 0)
int | hour | The variable to store the hour in, passed by reference. |
int | minute | The variable to store the minute in, passed by reference. |
int | second | The variable to store the seconds in, passed by reference. |
Return Values:
The function itself returns a Unix Timestamp.
Examples:
new Hour, Minute, Second, Timestamp; Timestamp = gettime(Hour, Minute, Second); printf("%02d:%02d:%02d", Hour, Minute, Second); printf("Seconds since midnight 1st January 1970: %d", Timestamp);
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- getdate: Get the current date of the server.
- tickcount: Replacement for GetTickCount.