diff options
author | Ori Bernstein <ori@eigenstate.org> | 2020-09-26 11:20:42 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2020-09-26 11:20:42 -0700 |
commit | d9f9e10e7b3ad61342ec1d9b034dd17f8452ccbc (patch) | |
tree | 3a0b155a8b2273cfe41110fe0a15ce50d6eb1e4f /sys/src/cmd/upas/Mail/reply.c | |
parent | 9afa5550f7497f84fb157ba07ff94301dbe06bcc (diff) |
upas: convert to tmdate, change timezone format
Complete the conversion of upas to remove ctime,
use the new date library, and print time zones
in +hhmm format, instead of NNN format.
This may affect code that expects specific names
for timezones. Fix that code.
Diffstat (limited to 'sys/src/cmd/upas/Mail/reply.c')
-rw-r--r-- | sys/src/cmd/upas/Mail/reply.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/src/cmd/upas/Mail/reply.c b/sys/src/cmd/upas/Mail/reply.c index 44e45fa39..9a04ed5c9 100644 --- a/sys/src/cmd/upas/Mail/reply.c +++ b/sys/src/cmd/upas/Mail/reply.c @@ -388,7 +388,9 @@ mesgsend(Message *m) Channel *sync; Message *r; int first, nfld, delit, ofd; - char *copy, *fld[100], *now; + char *copy, *fld[100]; + Tzone *tz; + Tm now; body = winreadbody(m->w, &n); /* assemble to: list from first line, to: line, and cc: line */ @@ -467,11 +469,12 @@ mesgsend(Message *m) ofd = open(outgoing, OWRITE|OCEXEC); /* no error check necessary */ if(ofd >= 0){ - /* From dhog Fri Aug 24 22:13:00 EDT 2001 */ - now = ctime(time(0)); - fprint(ofd, "From %s %s", user, now); + /* From dhog Fri Aug 24 22:13:00 +0500 2001 */ + tz = tzload("local"); + tmnow(&now, tz); + fprint(ofd, "From %s %τ", user, tmfmt(&now, "WW MMM _D hh:mm:ss Z YYYY")); fprint(ofd, "From: %s\n", user); - fprint(ofd, "Date: %s", now); + fprint(ofd, "Date: %τ", tmfmt(&now, "WW MMM _D hh:mm:ss Z YYYY")); for(i=0; i<natt; i++) if(included[i]) fprint(ofd, "Include: %s\n", attlist[i]); |