summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-05-16 14:45:11 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-05-16 14:45:11 +0200
commitb0583e5373e10119fd88d935cdded1e153101e22 (patch)
tree2281fe1f09492c8a528e48356571776ec7401324 /tools.c
parent6e274dfeef1987bebfa2d662fc40e03bbad4951f (diff)
downloadvdr-b0583e5373e10119fd88d935cdded1e153101e22.tar.gz
vdr-b0583e5373e10119fd88d935cdded1e153101e22.tar.bz2
Switched from 'summary.vdr' to 'info.vdr'
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 28ea2afc..075be185 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 1.91 2005/03/20 14:44:33 kls Exp $
+ * $Id: tools.c 1.92 2005/05/16 09:55:26 kls Exp $
*/
#include "tools.h"
@@ -571,6 +571,25 @@ cString TimeToString(time_t t)
return "???";
}
+cString DateString(time_t t)
+{
+ char buf[32];
+ struct tm tm_r;
+ tm *tm = localtime_r(&t, &tm_r);
+ char *p = stpcpy(buf, WeekDayName(tm->tm_wday));
+ *p++ = ' ';
+ strftime(p, sizeof(buf) - (p - buf), "%d.%m.%Y", tm);
+ return buf;
+}
+
+cString TimeString(time_t t)
+{
+ char buf[25];
+ struct tm tm_r;
+ strftime(buf, sizeof(buf), "%R", localtime_r(&t, &tm_r));
+ return buf;
+}
+
// --- cReadLine -------------------------------------------------------------
char *cReadLine::Read(FILE *f)