| 106 | } |
| 107 | |
| 108 | const 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 |
no outgoing calls
no test coverage detected