| iMatix home page | << | < | > | >> |
![]() Version 1.91 |
#include "sflmime.h" char * encode_mime_time (long date, long time)
Encode date and time (in long format) in Mime RFC1123 date format, e.g. Mon, 12 Jan 1995 12:05:01 GMT. Returns the string if it could encode the date and time okay, else returns "?".
{ int day_week, /* Day of week number (0 is sunday) */ month; /* Month number */ static char buffer [LINE_MAX]; day_week = day of week (date); month = GET_MONTH (date); if (day_week >= 0 && day_week < 7 && month > 0 && month < 13) { sprintf (buffer, "%s, %02d %s %04d %02d:%02d:%02d GMT", days [day_week], GET_DAY (date), months [month - 1], GET_CCYEAR (date), GET_HOUR (time), GET_MINUTE (time), GET_SECOND (time) ); return (buffer); } else return ("?"); }
| << | < | > | >> |
![]() |