From 646af88261222419ac3fbe9af6f736aa4bb5a6eb Mon Sep 17 00:00:00 2001 From: reznet Date: Tue, 11 Aug 2015 15:04:30 -0500 Subject: [PATCH] Display daily line cursor in local time The daily screen displays day and time of the graph cursor as the mouse moves around the graphs. Since this time is displayed to the user, it should appear in the local time zone. --- sleepyhead/daily.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sleepyhead/daily.cpp b/sleepyhead/daily.cpp index 1cfa37ce..acc5c516 100644 --- a/sleepyhead/daily.cpp +++ b/sleepyhead/daily.cpp @@ -1998,7 +1998,8 @@ void Daily::RedrawGraphs() void Daily::on_LineCursorUpdate(double time) { if (time > 1) { - QDateTime dt = QDateTime::fromMSecsSinceEpoch(time, Qt::UTC); + // use local time since this string is displayed to the user + QDateTime dt = QDateTime::fromMSecsSinceEpoch(time, Qt::LocalTime); QString txt = dt.toString("MMM dd HH:mm:ss.zzz"); dateDisplay->setText(txt); } else dateDisplay->setText(QString(GraphView->emptyText()));