summaryrefslogtreecommitdiffstats
path: root/core/qthelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r--core/qthelper.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index 262399a5f..03dd56637 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -743,6 +743,14 @@ int gettimezoneoffset(timestamp_t when)
return dt2.secsTo(dt1);
}
+QString render_seconds_to_string(int seconds)
+{
+ if (seconds % 60 == 0)
+ return QDateTime::fromTime_t(seconds).toUTC().toString("h:mm");
+ else
+ return QDateTime::fromTime_t(seconds).toUTC().toString("h:mm:ss");
+}
+
int parseDurationToSeconds(const QString &text)
{
int secs;