dtparser.c
/*
  rfc5322_date_create():
   Given a `time_t` date, this function creates a RFC5322 compliant date
   string.
 */
Given a `time_t` date, this function creates a RFC5322 compliant date
string.
Given a ` time_t ` date this function creates a RFC5322 compliant date string .
int rfc5322_date_create(time_t date, char *buf, size_t len)
{
        struct tm *tm = localtime(&date);
        long gmtoff = gmtoff_of(tm, date);
        int gmtnegative = 0;
        if (gmtoff < 0) {
                gmtoff = -gmtoff;
                gmtnegative = 1;
        }
        gmtoff /= 60;
    return snprintf(buf, len,
             "%s, %02d %s %04d %02d:%02d:%02d %c%02lu%02lu",
             weekdays[tm->tm_wday],
             tm->tm_mday, monthnames[tm->tm_mon], tm->tm_year + 1900,
             tm->tm_hour, tm->tm_min, tm->tm_sec,
             gmtnegative ? '-' : '+', gmtoff/60, gmtoff%60);
}
int rfc5322_date_create ( time_t date , char * buf , size_t len ) { struct tm * tm = localtime ( & date ) ; long gmtoff = gmtoff_of ( tm , date ) ; int gmtnegative = 0 ; if ( gmtoff < 0 ) { gmtoff = - gmtoff ; gmtnegative = 1 ; } gmtoff /= 60 ; return snprintf ( buf , len , " " , weekdays [ tm -> tm_wday ] , tm -> tm_mday , monthnames [ tm -> tm_mon ] , tm -> tm_year + 1900 , tm -> tm_hour , tm -> tm_min , tm -> tm_sec , gmtnegative ? ' ' : ' ' , gmtoff / 60 , gmtoff % 60 ) ; }
rfc5322_date_create():
Given a `time_t` date, this function creates a RFC5322 compliant date
string.
rfc5322_date_create () : Given a ` time_t ` date this function creates a RFC5322 compliant date string .