/* gettime(&hour, &minute, &second)
* The return value is the number of seconds since 1 January 1970 (Unix system
* time).
*/
static cell AMX_NATIVE_CALL n_gettime(AMX *amx, cell *params)
{
time_t sec1970;
struct tm gtm;
cell *cptr;
assert(params[0]==(int)(3*sizeof(cell)));
time(&sec1970);
/* on DOS/Windows, the timezone is usually not set for the C run-time
* library; in that case gmtime() and localtime() return the same value
*/
gtm=*localtime(&sec1970);
if (amx_GetAddr(amx,params[1],&cptr)==AMX_ERR_NONE)
*cptr=gtm.tm_hour;
if (amx_GetAddr(amx,params[2],&cptr)==AMX_ERR_NONE)
*cptr=gtm.tm_min;
if (amx_GetAddr(amx,params[3],&cptr)==AMX_ERR_NONE)
*cptr=gtm.tm_sec;
/* the time() function returns the number of seconds since January 1 1970
* in Universal Coordinated Time (the successor to Greenwich Mean Time)
*/
return sec1970;
}