#7553 HDF Summary Reader : Support HH:MM:SS when parsing start date

This commit is contained in:
Magne Sjaastad
2021-04-09 02:28:53 -07:00
parent dd97e7741a
commit 509cc31cc8
@@ -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 {};
} }