summaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-05-23 22:23:07 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-05-23 22:26:05 +0200
commitf5efea85a6874e4dcb206f91cedf29ef3d56f06b (patch)
treef678e72cb80226f178ef89a9faf52166701a64cf /src/utils.c
parent7fa1f0e2aa70a610d6de76e2194857b2ddc36b18 (diff)
parentb4cefe2db9d45dfba9bfd633288a406a8ad2a4c3 (diff)
downloadcalcurse-f5efea85a6874e4dcb206f91cedf29ef3d56f06b.zip
Merge branch 'maint'
Conflicts: src/io.c src/notify.c src/utils.c
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c
index ad88117..b3d9c71 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -386,8 +386,15 @@ char *date_sec2date_str(long sec, const char *datefmt)
/* Generic function to format date. */
void date_sec2date_fmt(long sec, const char *fmt, char *datef)
{
- struct tm *lt = localtime((time_t *) & sec);
+ /* TODO: Find a better way to deal with localization and strftime(). */
+ char *locale_old = mem_strdup (setlocale (LC_ALL, NULL));
+ setlocale (LC_ALL, "C");
+
+ struct tm *lt = localtime((time_t *)&sec);
strftime(datef, BUFSIZ, fmt, lt);
+
+ setlocale (LC_ALL, locale_old);
+ mem_free (locale_old);
}
/*