diff options
author | Rolf Ahrenberg <Rolf.Ahrenberg@sci.fi> | 2011-02-11 22:31:46 +0200 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2011-02-11 22:44:52 +0100 |
commit | 9ffb94a275c285bb70d9e21037c882956bb6001e (patch) | |
tree | 92d8a0d02def8c7ec4bd93b3512317c996a13d8e /tools.cpp | |
parent | 2e2f11b1a0435ca6c43614d63a0a63c823981589 (diff) | |
download | vdr-plugin-live-9ffb94a275c285bb70d9e21037c882956bb6001e.tar.gz vdr-plugin-live-9ffb94a275c285bb70d9e21037c882956bb6001e.tar.bz2 |
Unified date formatting and added recording duration format into translations.
Diffstat (limited to 'tools.cpp')
-rw-r--r-- | tools.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -51,6 +51,17 @@ istream& operator>>( istream& is, tChannelID& ret ) namespace vdrlive { + string FormatDuration( char const* format, int duration ) + { + char result[ 32 ]; + if ( snprintf(result, sizeof(result), format, duration) < 0 ) { + ostringstream builder; + builder << "cannot represent duration " << duration << " as requested"; + throw runtime_error( builder.str() ); + } + return result; + } + string FormatDateTime( char const* format, time_t time ) { struct tm tm_r; |