If you find timestamps in GMT too annoying apply following patch.
http://www.jms1.net/qmail/qmail-date-localtime.patch
Works with qmail 1.01 to 1.03 and netqmail-1.05
Patch is reproduced here because mentioned site is not accessible
sometimes:
To apply this patch, cd into the qmail source directory and type...
patch -s -p1 <>
#include "datetime.h"
#include "fmt.h"
#include "date822fmt.h"
@@ -12,18 +13,51 @@
{
unsigned int i;
unsigned int len;
+ time_t now;
+ datetime_sec utc;
+ datetime_sec local;
+ struct tm *tm;
+ struct datetime new_dt;
+ int minutes;
+
+ utc = datetime_untai(dt);
+ now = (time_t)utc;
+ tm = localtime(&now);
+ new_dt.year = tm->tm_year;
+ new_dt.mon = tm->tm_mon;
+ new_dt.mday = tm->tm_mday;
+ new_dt.hour = tm->tm_hour;
+ new_dt.min = tm->tm_min;
+ new_dt.sec = tm->tm_sec;
+ local = datetime_untai(&new_dt);
+
len = 0;
- i = fmt_uint(s,dt->mday); len += i; if (s) s += i;
+ i = fmt_uint(s,new_dt.mday); len += i; if (s) s += i;
i = fmt_str(s," "); len += i; if (s) s += i;
- i = fmt_str(s,montab[dt->mon]); len += i; if (s) s += i;
+ i = fmt_str(s,montab[new_dt.mon]); len += i; if (s) s += i;
i = fmt_str(s," "); len += i; if (s) s += i;
- i = fmt_uint(s,dt->year + 1900); len += i; if (s) s += i;
+ i = fmt_uint(s,new_dt.year + 1900); len += i; if (s) s += i;
i = fmt_str(s," "); len += i; if (s) s += i;
- i = fmt_uint0(s,dt->hour,2); len += i; if (s) s += i;
+ i = fmt_uint0(s,new_dt.hour,2); len += i; if (s) s += i;
i = fmt_str(s,":"); len += i; if (s) s += i;
- i = fmt_uint0(s,dt->min,2); len += i; if (s) s += i;
+ i = fmt_uint0(s,new_dt.min,2); len += i; if (s) s += i;
i = fmt_str(s,":"); len += i; if (s) s += i;
- i = fmt_uint0(s,dt->sec,2); len += i; if (s) s += i;
- i = fmt_str(s," -0000\n"); len += i; if (s) s += i;
+ i = fmt_uint0(s,new_dt.sec,2); len += i; if (s) s += i;
+
+ if (local < minutes =" (utc" i =" fmt_str(s," i =" fmt_uint0(s,minutes" i =" fmt_uint0(s,minutes" minutes =" (local" i =" fmt_str(s," i =" fmt_uint0(s,minutes" i =" fmt_uint0(s,minutes" i =" fmt_str(s,">
Generate timestamps in local timezone using patch
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment