Definition at line 13 of file Tm.h.
void Tm::setToString |
( |
const std::string |
s | ) |
|
|
noexcept |
Definition at line 150 of file Tm.cc.
References alignCSCRings::e, mps_check::msg, and alignCSCRings::s.
Referenced by LMFCorrCoefDat::fetchAfter(), LMFCorrCoefDat::fetchBetween(), RunDCSHVDat::fillTheMapByTime(), LMFRunIOV::getDBInsertionTime(), LMFLmrSubIOV::getIOVIDsLaterThan(), popcon::EcalLaserHandler::getNewObjects(), LMFSeqDat::getSequenceStart(), LMFSeqDat::getSequenceStop(), LMFRunIOV::getSubRunEnd(), and LMFRunIOV::getSubRunStart().
152 "%04d-%02d-%02d %02d:%02d:%02d",
161 if (
m_tm.tm_year > 9999 ||
m_tm.tm_year < 1900) {
162 throw(std::runtime_error(
"Year out of bounds"));
163 }
else if (
m_tm.tm_mon > 12 ||
m_tm.tm_mon < 1) {
164 throw(std::runtime_error(
"Month out of bounds"));
165 }
else if (
m_tm.tm_mday > 31 ||
m_tm.tm_mday < 1) {
166 throw(std::runtime_error(
"Day out of bounds"));
167 }
else if (
m_tm.tm_hour > 23 ||
m_tm.tm_mday < 0) {
168 throw(std::runtime_error(
"Hour out of bounds"));
169 }
else if (
m_tm.tm_min > 59 ||
m_tm.tm_min < 0) {
170 throw(std::runtime_error(
"Minute out of bounds"));
171 }
else if (
m_tm.tm_sec > 59 ||
m_tm.tm_sec < 0) {
172 throw(std::runtime_error(
"Day out of bounds"));
175 if (
m_tm.tm_year >= 2038) {
178 if (
m_tm.tm_mon > 1) {
181 if (
m_tm.tm_mday > 19) {
184 if (
m_tm.tm_hour > 3) {
187 if (
m_tm.tm_min > 14) {
190 if (
m_tm.tm_sec > 7) {
194 m_tm.tm_year -= 1900;
196 }
catch (std::runtime_error &
e) {
198 string msg(
"Tm::setToString(): ");
199 msg.append(e.what());
200 throw(std::runtime_error(
msg));
"One hour shif" fix Create a temporary dummy object that is in GMT and use it to generate the output. This is to avoid the "one hour
shift" related to the Summer time and the value of m_tm.tm_isdst, see [1]. It guaranties that the output is always in GMT / UTC. [1] https://hypernews.cern.ch/HyperNews/CMS/get/ecalDB/66.html
Definition at line 66 of file Tm.cc.
References c_tm(), setToGMTime(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by LMFCorrCoefDat::fetchBetween(), LMFSeqDat::fetchByRunNumber(), RunDCSHVDat::fillTheMapByTime(), LMFCorrCoefDat::getCorrections(), popcon::EcalLaserHandler::getNewObjects(), LMFRunIOV::getParameters(), LMFSeqDat::getParameters(), DataReducer< T >::getReducedDataList(), LMFRunIOV::initialize(), LMFSeqDat::LMFSeqDat(), operator<<(), EcalTPGDBApp::printIOV(), LMFUnique::sequencePostfix(), LMFSeqDat::setSequenceStart(), LMFSeqDat::setSequenceStop(), LMFRunIOV::setSubRunEnd(), and LMFRunIOV::setSubRunStart().
80 char timebuf[20] =
"";
82 sprintf(timebuf,
"9999-12-12 23:59:59");
86 struct tm dummy_tm = dummy_Tm.
c_tm();
87 strftime(timebuf, 20,
"%Y-%m-%d %H:%M:%S", &dummy_tm);
uint64_t microsTime() const
void setToGMTime(time_t t)
static const uint64_t PLUS_INF_MICROS