commit 315c36f57ada6030ca250fb103df80d8fffadb51
parent f011c092f921514df9cc293a4ab3ffa4ce5ab4cf
Author: lostd <lostd@2f30.org>
Date: Thu, 13 Oct 2016 16:52:15 +0200
Customize strftime(3) format in config.h
Thanks to André Alvaro.
Diffstat:
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
@@ -1,5 +1,7 @@
/* delay between each update in seconds */
int delay = 1;
+/* format for dateread */
+char timeformat[] = "%a %d %b %Y %H:%M %Z";
struct ent ents[] = {
/* reorder this if you want */
diff --git a/date.c b/date.c
@@ -4,6 +4,8 @@
#include <stdio.h>
#include <time.h>
+extern char timeformat[];
+
int
dateread(char *buf, size_t len)
{
@@ -14,6 +16,6 @@ dateread(char *buf, size_t len)
now = localtime(&t);
if (now == NULL)
return -1;
- strftime(buf, len, "%a %d %b %Y %H:%M %Z", now);
+ strftime(buf, len, timeformat, now);
return 0;
}