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

Method format

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

Source from the content-addressed store, hash-verified

105 }
106
107 inline std::string format(const char *fmt = "%Y-%m-%d") const {
108 char txt[32];
109 struct tm temp = m_tm;
110 temp.tm_year -= baseYear(); // adjust for fact that system has year rel. to 1900
111 size_t res = ::strftime(txt, 31, fmt, &temp);
112 if (res == 0) {
113 return std::string("");
114 } else {
115 return std::string(txt);
116 }
117 }
118
119 friend inline std::ostream &operator<<(std::ostream & os, const Date d);
120

Callers 6

Date_formatFunction · 0.45
Datetime_formatFunction · 0.45
formatImplFunction · 0.45
newDateVector.hFile · 0.45
Date.hFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected