summaryrefslogtreecommitdiffstats
path: root/core/qthelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r--core/qthelper.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index 0de3e6002..203234f05 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -5,7 +5,6 @@
#include "core/settings/qPrefUpdateManager.h"
#include "core/subsurface-qt/divelistnotifier.h"
#include "subsurface-string.h"
-#include "subsurface-string.h"
#include "gettextfromc.h"
#include "statistics.h"
#include "membuffer.h"
@@ -955,6 +954,12 @@ QString get_dive_date_string(timestamp_t when)
return loc.toString(ts.toUTC(), QString(prefs.date_format) + " " + prefs.time_format);
}
+// Get local seconds since Epoch from ISO formatted UTC date time + offset string
+extern "C" time_t get_dive_datetime_from_isostring(char *when) {
+ QDateTime divetime = QDateTime::fromString(when, Qt::ISODate);
+ return (time_t)(divetime.toSecsSinceEpoch());
+}
+
QString get_short_dive_date_string(timestamp_t when)
{
QDateTime ts;