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;
|
||||
@ -53,7 +50,7 @@ public:
|
||||
|
||||
private:
|
||||
std::unique_ptr<RifColumnBasedUserDataParser> m_parser;
|
||||
std::vector< std::vector<time_t> > m_timeSteps;
|
||||
std::vector< std::vector<time_t> > m_timeSteps;
|
||||
|
||||
std::map<RifEclipseSummaryAddress, size_t > m_mapFromAddressToTimeStepIndex;
|
||||
std::map<RifEclipseSummaryAddress, std::pair<size_t, size_t> > m_mapFromAddressToResultIndex;
|
||||
|
@ -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;
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
virtual std::string unitName(const RifEclipseSummaryAddress& resultAddress) const = 0;
|
||||
|
||||
// TODO: Move this to a tools class with static members
|
||||
static std::vector<QDateTime> fromTimeT(const std::vector<time_t>& timeSteps);
|
||||
static std::vector<QDateTime> fromTimeT(const std::vector<time_t>& timeSteps);
|
||||
|
||||
protected:
|
||||
std::vector<RifEclipseSummaryAddress> m_allResultAddresses;
|
||||
|
Loading…
Reference in New Issue
Block a user