Logo Search packages:      
Sourcecode: condor version File versions  Download package

Literal * Literal::MakeRelTime ( time_t  secs = -1  )  [static]

Create a relative time literal.

Parameters:
secs The number of seconds. If a value of -1 is passed in the time since midnight (i.e., the daytime) is used.
Returns:
The literal expression.

Definition at line 252 of file literals.cpp.

References MakeLiteral(), and Value::SetRelativeTimeValue().

{
      Value       val;
      struct      tm    lt;

      if( secs<0 ) {
            time(&secs );
            getLocalTime( &secs, &lt );
      }
      val.SetRelativeTimeValue((time_t) (lt.tm_hour*3600 + lt.tm_min*60 + lt.tm_sec));
      return( MakeLiteral( val ) );
}


Generated by  Doxygen 1.6.0   Back to index