summaryrefslogtreecommitdiff
path: root/sys/src/cmd/upas/common/libsys.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2020-09-26 11:20:42 -0700
committerOri Bernstein <ori@eigenstate.org>2020-09-26 11:20:42 -0700
commitd9f9e10e7b3ad61342ec1d9b034dd17f8452ccbc (patch)
tree3a0b155a8b2273cfe41110fe0a15ce50d6eb1e4f /sys/src/cmd/upas/common/libsys.c
parent9afa5550f7497f84fb157ba07ff94301dbe06bcc (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/common/libsys.c')
-rw-r--r--sys/src/cmd/upas/common/libsys.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/src/cmd/upas/common/libsys.c b/sys/src/cmd/upas/common/libsys.c
index 969c2ff67..392d3ff40 100644
--- a/sys/src/cmd/upas/common/libsys.c
+++ b/sys/src/cmd/upas/common/libsys.c
@@ -5,14 +5,15 @@
/*
* return the date
*/
-char*
-thedate(void)
+Tmfmt
+thedate(Tm *tm)
{
- static char now[64];
+ Tzone *tz;
- strcpy(now, ctime(time(0)));
- now[28] = 0;
- return now;
+ /* if the local time is screwed, just do gmt */
+ tz = tzload("local");
+ tmnow(tm, tz);
+ return tmfmt(tm, Timefmt);
}
/*