MCPcopy Create free account
hub / github.com/Rblp/Rblpapi / eleToDatetime

Function eleToDatetime

src/subscribe.cpp:94–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94SEXP eleToDatetime(const Element& e) {
95
96 // sometimes bbg uses BLPAPI_DATATYPE_DATETIME for timestamps w/ no day/month/year attribues
97 if(e.getValueAsDatetime().hasParts(DatetimeParts::DATE)) {
98 Rcpp::DatetimeVector ans(e.numValues());
99 for(size_t i = 0; i < e.numValues(); ++i) {
100 ans[i] = bbgDatetimeToPOSIX(e.getValueAsDatetime(i));
101 }
102 return Rcpp::wrap(ans);
103 } else {
104 return eleToString(e);
105 }
106}
107
108SEXP eleToArray(const Element& e) {
109 if(e.isNull()) { return R_NilValue; }

Callers 1

eleToArrayFunction · 0.85

Calls 2

bbgDatetimeToPOSIXFunction · 0.85
eleToStringFunction · 0.85

Tested by

no test coverage detected