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

Literal * Literal::MakeAbsTime ( abstime_t *  now = NULL  )  [static]

Create an absolute time literal.

Parameters:
now The time in UNIX epoch. If a value of NULL is passed in the system's current time will be used.
Returns:
The literal expression.

Definition at line 103 of file literals.cpp.

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

{
    Value val;
    abstime_t abst;
    if (tim == NULL) { // => current time/offset
        time_t now;
        struct tm tt;
        time( &now );
        getLocalTime(&now, &tt);
        abst.secs = now;
        abst.offset = -timezone_offset();
        if (tt.tm_isdst > 0) { // add an hour to the offset, if day-light saving is set
            abst.offset += 3600;
        }
        abst.secs += abst.offset;
    }
    else { //make a literal out of the passed value
        abst = *tim;
    }
    val.SetAbsoluteTimeValue( abst);
    return( MakeLiteral( val ) );
}


Generated by  Doxygen 1.6.0   Back to index