Update of /cvsroot/binaryphp/binaryphp/functions/timedate
In directory sc8-pr-cvs1:/tmp/cvs-serv18998/functions/timedate
Added Files:
gettimeofday.cpp time.cpp
Log Message:
Committing for Lateralus
Update docs/AUTHORS and functions.php
Created functions/timedate/time.cpp and gettimeofday.cpp
--- NEW FILE: gettimeofday.cpp ---
php_var gettimeofday()
{
//php vars
php_var ret; //The return variable
ret.to_array(); //An assosiative array will be returned.
//time vars
struct timeval tp;
struct timezone tz;
if( gettimeofday( &tp, &tz ) == 0 ){
ret['sec'] = tp.tv_sec;
ret['usec'] = tp.tv_usec;
#ifdef __WIN32
ret['minuteswest'] = tz.tz_minuteswest/60;
#else
ret['minuteswest'] = tz.tz_minuteswest;
#endif
ret['dsttime'] = tz.tz_dsttime;
return ret;
} else {
return false;
}
}
--- NEW FILE: time.cpp ---
php_var time()
{
//php vars
php_var ret; //The return variable
ret = ((long)time(NULL));
return ret;
}
|