MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / update_tm

Method update_tm

inst/include/Rcpp/date_datetime/Date.h:126–134  ·  view source on GitHub ↗

update m_tm based on m_d

Source from the content-addressed store, hash-verified

124
125 // update m_tm based on m_d
126 void update_tm() {
127 if (R_FINITE(m_d)) {
128 time_t t = static_cast<time_t>(24*60*60 * m_d); // (fractional) days since epoch to seconds since epoch
129 m_tm = *gmtime_(&t);
130 } else {
131 m_tm.tm_sec = m_tm.tm_min = m_tm.tm_hour = m_tm.tm_isdst = NA_INTEGER;
132 m_tm.tm_min = m_tm.tm_hour = m_tm.tm_mday = m_tm.tm_mon = m_tm.tm_year = NA_INTEGER;
133 }
134 }
135
136 };
137

Callers

nothing calls this directly

Calls 1

gmtime_Function · 0.50

Tested by

no test coverage detected