fastrpc
fastrpc copied to clipboard
pool.DateTime(time_t, tz) and UTCTime(time_t) are wrong
The root cause is that the constructor of DateTime(time_t, timezone) will ignore the timezone altogether, so the component part of the time specification will be offset.
#include <iostream>
#include <frpcpool.h>
#include <frpcdatetime.h>
int main() {
FRPC::Pool_t pool;
auto &dt = pool.UTCTime(0);
std::cout << dt.isoFormat() << std::endl;
return 0;
}
outputs:
19700101T01:00:00+0000
which should be
19700101T00:00:00+0000
or
19700101T01:00:00+0100