Logo Search packages:      
Sourcecode: wvstreams version File versions

WvString rfc822_date ( time_t  _when = -1  ) 

Returns an RFC822-compatible date made out of _when, or, if _when < 0, out of the current time.

Definition at line 373 of file strutils.cc.

References WvString::edit(), rfc822_date(), and WvFastString::setsize().

Referenced by rfc822_date().

    WvString out;

    if (when < 0)
        when = time(NULL);

    struct tm *tmwhen = localtime(&when);
    strftime(out.edit(), 80, "%a, %d %b %Y %H:%M:%S %z", tmwhen);

    return out;

Generated by  Doxygen 1.6.0   Back to index