mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 07:03:25 -06:00
#7568 Summary HDF : Use time conversion methods from Opm::TimeStampUTC
This commit is contained in:
parent
8f00c527b1
commit
9ecfefe094
@ -21,6 +21,7 @@
|
|||||||
#include "RifHdf5Exporter.h"
|
#include "RifHdf5Exporter.h"
|
||||||
#include "RifSummaryReaderInterface.h"
|
#include "RifSummaryReaderInterface.h"
|
||||||
|
|
||||||
|
#include "opm/common/utility/TimeService.hpp"
|
||||||
#include "opm/io/eclipse/ESmry.hpp"
|
#include "opm/io/eclipse/ESmry.hpp"
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
@ -68,17 +69,17 @@ bool RifHdf5SummaryExporter::writeGeneralSection( RifHdf5Exporter& exporter, Opm
|
|||||||
{
|
{
|
||||||
auto startDate = sourceSummaryData.startdate();
|
auto startDate = sourceSummaryData.startdate();
|
||||||
|
|
||||||
time_t firstTimeStep = std::chrono::system_clock::to_time_t( startDate );
|
// Make sure we convert time identically as the inverse of make_date in ESmry.cpp
|
||||||
|
time_t firstTimeStep = std::chrono::system_clock::to_time_t( startDate );
|
||||||
|
Opm::TimeStampUTC opmTimeStamp( firstTimeStep );
|
||||||
|
|
||||||
QDateTime dt = QDateTime::fromTime_t( firstTimeStep );
|
int day = opmTimeStamp.day();
|
||||||
|
int month = opmTimeStamp.month();
|
||||||
|
int year = opmTimeStamp.year();
|
||||||
|
|
||||||
int day = dt.date().day();
|
int hour = opmTimeStamp.hour();
|
||||||
int month = dt.date().month();
|
int minute = opmTimeStamp.minutes();
|
||||||
int year = dt.date().year();
|
int second = opmTimeStamp.seconds();
|
||||||
|
|
||||||
int hour = dt.time().hour();
|
|
||||||
int minute = dt.time().minute();
|
|
||||||
int second = dt.time().second();
|
|
||||||
|
|
||||||
std::vector<int> timeValues( 7 );
|
std::vector<int> timeValues( 7 );
|
||||||
timeValues[0] = day;
|
timeValues[0] = day;
|
||||||
|
Loading…
Reference in New Issue
Block a user