12.04.2011, 18:36
Hi, i need Script Modification, which calculated Unix Time.
It's about the time in seconds that has elapsed since 1 January 1970.
It's about the time in seconds that has elapsed since 1 January 1970.
#define TIME_MS 1
#define TIME_S 2
#define TIME_M 3
#define TIME_H 4
stock ReturnTimeSinceTime(Time1, Time2, Method = TIME_S)
{
if(Method == TIME_MS) return (Time1 - Time2 * 1000);
else if(Method == TIME_S) return (Time1 - Time2);
else if(Method == TIME_M) return (Time1 - Time2 / 60);
else if(Method == TIME_H) return ( (Time1 - Time2 / 60) / 60);
}
new time = gettime();
ReturnTimeSinceTime(time, gettime());
stock UNIX_TIMESTAMP()
{
new
buf;
// Fetching the timestamp
mysql_query("SELECT UNIX_TIMESTAMP()");
mysql_store_result();
buf = mysql_fetch_int();
mysql_free_result();
return buf;
}