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

Function bbgDatetimeToPOSIX

src/blpapi_utils.cpp:108–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108const double bbgDatetimeToPOSIX(const Datetime& dt) {
109 boost::gregorian::date bbg_boost_date(dt.year(),dt.month(),dt.day());
110 boost::posix_time::time_duration td =
111 boost::posix_time::hours(dt.hours()) +
112 boost::posix_time::minutes(dt.minutes()) +
113 boost::posix_time::seconds(dt.seconds()) +
114 boost::posix_time::milliseconds(dt.milliseconds());
115
116 boost::posix_time::ptime bbg_ptime(bbg_boost_date,td);
117 struct tm tm_time(to_tm(bbg_ptime));
118 return static_cast<double>(mktime(&tm_time));
119}
120
121// In case data already comes in localtime (cf TZDF<GO>)
122// we need to adjust back to UTC

Callers 2

populateDfRowBDSFunction · 0.85
eleToDatetimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected