mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1984 Ensure QDateTime spec set to UTC
This commit is contained in:
parent
97e60ab5f2
commit
6674f6087a
@ -122,7 +122,7 @@ QDateTime RiaQDateTimeTools::epoch()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RiaQDateTimeTools::createDateTime()
|
||||
QDateTime RiaQDateTimeTools::createUtcDateTime()
|
||||
{
|
||||
auto qdt = QDateTime();
|
||||
qdt.setTimeSpec(currentTimeSpec());
|
||||
@ -132,7 +132,7 @@ QDateTime RiaQDateTimeTools::createDateTime()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RiaQDateTimeTools::createDateTime(const QDate& date)
|
||||
QDateTime RiaQDateTimeTools::createUtcDateTime(const QDate& date)
|
||||
{
|
||||
auto qdt = QDateTime(date);
|
||||
qdt.setTimeSpec(currentTimeSpec());
|
||||
@ -142,7 +142,7 @@ QDateTime RiaQDateTimeTools::createDateTime(const QDate& date)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RiaQDateTimeTools::createDateTime(const QDate& date, const QTime& time)
|
||||
QDateTime RiaQDateTimeTools::createUtcDateTime(const QDate& date, const QTime& time)
|
||||
{
|
||||
auto qdt = QDateTime(date, time, currentTimeSpec());
|
||||
return qdt;
|
||||
|
@ -43,9 +43,9 @@ public:
|
||||
|
||||
static QDateTime epoch();
|
||||
|
||||
static QDateTime createDateTime();
|
||||
static QDateTime createDateTime(const QDate& date);
|
||||
static QDateTime createDateTime(const QDate& date, const QTime& time);
|
||||
static QDateTime createUtcDateTime();
|
||||
static QDateTime createUtcDateTime(const QDate& date);
|
||||
static QDateTime createUtcDateTime(const QDate& date, const QTime& time);
|
||||
|
||||
private:
|
||||
static quint64 secondsInDay();
|
||||
|
@ -24,8 +24,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
class RimSummaryCurve;
|
||||
class RimAsciiDataCurve;
|
||||
class RicPasteAsciiDataToSummaryPlotFeatureUi;
|
||||
|
@ -22,11 +22,8 @@
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class QDateTime;
|
||||
class QString;
|
||||
|
||||
class RifColumnBasedUserDataParser;
|
||||
|
@ -20,12 +20,8 @@
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QLocale>
|
||||
#include <QString>
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct ColumnInfo;
|
||||
|
@ -160,7 +160,7 @@ void RifEclipseOutputFileTools::timeSteps(ecl_file_type* ecl_file, std::vector<Q
|
||||
int year = 0;
|
||||
getDayMonthYear(kwINTEHEAD, &day, &month, &year);
|
||||
|
||||
QDateTime reportDateTime = RiaQDateTimeTools::createDateTime(QDate(year, month, day));
|
||||
QDateTime reportDateTime = RiaQDateTimeTools::createUtcDateTime(QDate(year, month, day));
|
||||
CVF_ASSERT(reportDateTime.isValid());
|
||||
|
||||
double dayValue = dayValues[i];
|
||||
|
@ -258,9 +258,7 @@ QDateTime RifHdf5Reader::sourSimDateTimeToQDateTime(std::string dateString) cons
|
||||
QDate d(year, month, day);
|
||||
QTime t(hours, minutes, seconds);
|
||||
|
||||
QDateTime dt;
|
||||
dt.setDate(d);
|
||||
dt.setTime(t);
|
||||
QDateTime dt = RiaQDateTimeTools::createUtcDateTime(d, t);
|
||||
|
||||
return dt;
|
||||
}
|
||||
|
@ -29,7 +29,6 @@
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QDateTime>
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class QDateTime;
|
||||
class QString;
|
||||
|
||||
class RifColumnBasedAsciiParser;
|
||||
|
Loading…
Reference in New Issue
Block a user