diff --git a/ApplicationLibCode/Application/Tools/RiaQDateTimeTools.cpp b/ApplicationLibCode/Application/Tools/RiaQDateTimeTools.cpp index 3628d4a7f6..bf398267de 100644 --- a/ApplicationLibCode/Application/Tools/RiaQDateTimeTools.cpp +++ b/ApplicationLibCode/Application/Tools/RiaQDateTimeTools.cpp @@ -135,7 +135,7 @@ QDateTime RiaQDateTimeTools::fromYears( double years ) QDateTime RiaQDateTimeTools::fromTime_t( time_t t ) { auto qdt = createUtcDateTime(); - qdt.setTime_t( t ); + qdt.setSecsSinceEpoch( t ); return qdt; } diff --git a/ApplicationLibCode/Commands/RicSummaryCaseRestartDialog.cpp b/ApplicationLibCode/Commands/RicSummaryCaseRestartDialog.cpp index e48e44844f..fd4c9a8603 100644 --- a/ApplicationLibCode/Commands/RicSummaryCaseRestartDialog.cpp +++ b/ApplicationLibCode/Commands/RicSummaryCaseRestartDialog.cpp @@ -498,9 +498,9 @@ void RicSummaryCaseRestartDialog::appendFileInfoToGridLayout( QGridLayout* { CVF_ASSERT( gridLayout ); - QDateTime startDate = QDateTime::fromTime_t( fileInfo.startDate ); + QDateTime startDate = QDateTime::fromSecsSinceEpoch( fileInfo.startDate ); QString startDateString = startDate.toString( RiaQDateTimeTools::dateFormatString() ); - QDateTime endDate = QDateTime::fromTime_t( fileInfo.endDate ); + QDateTime endDate = QDateTime::fromSecsSinceEpoch( fileInfo.endDate ); QString endDateString = endDate.toString( RiaQDateTimeTools::dateFormatString() ); int rowCount = gridLayout->rowCount(); diff --git a/ApplicationLibCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationLibCode/FileInterface/RifReaderEclipseOutput.cpp index b62a94e1da..38f65a928f 100644 --- a/ApplicationLibCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderEclipseOutput.cpp @@ -1678,7 +1678,7 @@ void RifReaderEclipseOutput::readWellCells( const ecl_grid_type* mainEclGrid, bo // Also see RifEclipseOutputFileAccess::timeStepsText for accessing time_t structures time_t stepTime = well_state_get_sim_time( ert_well_state ); - wellResFrame.m_timestamp = QDateTime::fromTime_t( stepTime ); + wellResFrame.m_timestamp = QDateTime::fromSecsSinceEpoch( stepTime ); } // Production type diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index 0ef42406ba..d0afd0713f 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -1174,8 +1174,8 @@ void RimSummaryCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, QString description; { - QDateTime first = QDateTime::fromTime_t( curveTimeStepsX.front() ); - QDateTime last = QDateTime::fromTime_t( curveTimeStepsX.back() ); + QDateTime first = QDateTime::fromSecsSinceEpoch( curveTimeStepsX.front() ); + QDateTime last = QDateTime::fromSecsSinceEpoch( curveTimeStepsX.back() ); std::vector timeSteps; timeSteps.push_back( first ); @@ -1189,8 +1189,8 @@ void RimSummaryCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, } { - QDateTime first = QDateTime::fromTime_t( curveTimeStepsY.front() ); - QDateTime last = QDateTime::fromTime_t( curveTimeStepsY.back() ); + QDateTime first = QDateTime::fromSecsSinceEpoch( curveTimeStepsY.front() ); + QDateTime last = QDateTime::fromSecsSinceEpoch( curveTimeStepsY.back() ); std::vector timeSteps; timeSteps.push_back( first ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 0389db33e4..87a844dd91 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -2494,7 +2494,7 @@ void appendToExportDataForCase( QString& out, const std::vector& timeSte } } out += "\n"; - out += QDateTime::fromTime_t( timeSteps[j] ).toUTC().toString( "yyyy-MM-dd hh:mm:ss " ); + out += QDateTime::fromSecsSinceEpoch( timeSteps[j] ).toUTC().toString( "yyyy-MM-dd hh:mm:ss " ); for ( size_t k = 0; k < curveData.size(); k++ ) // curves { @@ -2549,7 +2549,7 @@ void appendToExportData( QString& out, const std::vector& curvesData for ( auto timeStep : allTimeSteps ) { - QDateTime timseStepUtc = QDateTime::fromTime_t( timeStep ).toUTC(); + QDateTime timseStepUtc = QDateTime::fromSecsSinceEpoch( timeStep ).toUTC(); QString timeText; if ( showTimeAsLongString ) diff --git a/ApplicationLibCode/UnitTests/ObservedDataParser-Test.cpp b/ApplicationLibCode/UnitTests/ObservedDataParser-Test.cpp index 2af3674f1a..4da0bff5f7 100644 --- a/ApplicationLibCode/UnitTests/ObservedDataParser-Test.cpp +++ b/ApplicationLibCode/UnitTests/ObservedDataParser-Test.cpp @@ -931,7 +931,7 @@ TEST( RifKeywordBasedRsmspecParserTest, TestTimeSteps ) QDateTime firstDate = RiaQDateTimeTools::fromYears( 2014.32 ); - EXPECT_TRUE( firstDate == QDateTime::fromTime_t( timeSteps[0] ) ); + EXPECT_TRUE( firstDate == QDateTime::fromSecsSinceEpoch( timeSteps[0] ) ); } //--------------------------------------------------------------------------------------------------