+/* format date in IMAP style: DD-MMM-YYYY HH:MM:SS +ZZzz.
+ * Caller should provide a buffer of IMAP_DATELEN bytes */
+void imap_make_date (char *buf, time_t timestamp)
+{
+ struct tm* tm = localtime (×tamp);
+ time_t tz = mutt_local_tz (timestamp);
+
+ tz /= 60;
+
+ snprintf (buf, IMAP_DATELEN, "%02d-%s-%d %02d:%02d:%02d %+03d%02d",
+ tm->tm_mday, Months[tm->tm_mon], tm->tm_year + 1900,
+ tm->tm_hour, tm->tm_min, tm->tm_sec,
+ (int) tz / 60, (int) abs (tz) % 60);
+}
+