struct tm LogServer::setNextTime(int internal)
{
struct tm when;
time_t now, result;
int days=internal;
time( &now );
when = *localtime( &now );
//printf( "Current time is %s/n", asctime( &when ) );
when.tm_mday = when.tm_mday + days;
if( (result = mktime( &when )) != (time_t)-1 )
{
//snprintf(ptime,36,asctime( &when ));
//printf( "In %d days the time will be %s/n", days, asctime( &when ) );
return when;
}
else
return NULL;
}
{
struct tm when;
time_t now, result;
int days=internal;
time( &now );
when = *localtime( &now );
//printf( "Current time is %s/n", asctime( &when ) );
when.tm_mday = when.tm_mday + days;
if( (result = mktime( &when )) != (time_t)-1 )
{
//snprintf(ptime,36,asctime( &when ));
//printf( "In %d days the time will be %s/n", days, asctime( &when ) );
return when;
}
else
return NULL;
}