mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#7553 HDF Summary Reader : Support HH:MM:SS when parsing start date
This commit is contained in:
@@ -229,11 +229,19 @@ time_t RifHdf5SummaryReader::startDate() const
|
|||||||
values.resize( dims[0] );
|
values.resize( dims[0] );
|
||||||
dataset.read( values.data(), H5::PredType::NATIVE_INT );
|
dataset.read( values.data(), H5::PredType::NATIVE_INT );
|
||||||
|
|
||||||
int day = values[0];
|
int day = values[0];
|
||||||
int month = values[1];
|
int month = values[1];
|
||||||
int year = values[2];
|
int year = values[2];
|
||||||
|
int hour = values[3];
|
||||||
|
int minute = values[4];
|
||||||
|
int second = values[5];
|
||||||
|
|
||||||
QDateTime reportDateTime = RiaQDateTimeTools::createUtcDateTime( QDate( year, month, day ) );
|
QDate date( year, month, day );
|
||||||
|
QTime time( hour, minute, second );
|
||||||
|
|
||||||
|
QDateTime dt( date, time );
|
||||||
|
|
||||||
|
QDateTime reportDateTime = RiaQDateTimeTools::createUtcDateTime( dt );
|
||||||
|
|
||||||
time_t myTime = RiaTimeTTools::fromQDateTime( reportDateTime );
|
time_t myTime = RiaTimeTTools::fromQDateTime( reportDateTime );
|
||||||
return myTime;
|
return myTime;
|
||||||
@@ -241,9 +249,9 @@ time_t RifHdf5SummaryReader::startDate() const
|
|||||||
catch ( ... )
|
catch ( ... )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
RiaLogging::error( "Not able to read start_date from HDF5 " );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RiaLogging::error( "Not able to read start_date from HDF5 " );
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user