diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-05-16 14:45:11 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-05-16 14:45:11 +0200 |
commit | b0583e5373e10119fd88d935cdded1e153101e22 (patch) | |
tree | 2281fe1f09492c8a528e48356571776ec7401324 /tools.c | |
parent | 6e274dfeef1987bebfa2d662fc40e03bbad4951f (diff) | |
download | vdr-b0583e5373e10119fd88d935cdded1e153101e22.tar.gz vdr-b0583e5373e10119fd88d935cdded1e153101e22.tar.bz2 |
Switched from 'summary.vdr' to 'info.vdr'
Diffstat (limited to 'tools.c')
-rw-r--r-- | tools.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -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) |