2014-07-10 18:53:09 +00:00
|
|
|
|
#include <iostream>
|
2015-09-29 19:19:54 +00:00
|
|
|
|
#include <common/DateLUT.h>
|
2014-07-10 18:53:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char ** argv)
|
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
|
/** В DateLUT был глюк - для времён из дня 1970-01-01, возвращался номер часа больше 23. */
|
|
|
|
|
static const time_t TIME = 66130;
|
2014-07-10 18:53:09 +00:00
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
|
const auto & date_lut = DateLUT::instance();
|
2014-07-10 18:53:09 +00:00
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
|
std::cerr << date_lut.toHour(TIME) << std::endl;
|
|
|
|
|
std::cerr << date_lut.toDayNum(TIME) << std::endl;
|
2014-07-10 18:53:09 +00:00
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
|
const auto * values = reinterpret_cast<const DateLUTImpl::Values *>(&date_lut);
|
2014-07-10 18:53:09 +00:00
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
|
std::cerr << values[0].date << ", " << time_t(values[1].date - values[0].date) << std::endl;
|
2014-07-10 18:53:09 +00:00
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
|
return 0;
|
2014-07-10 18:53:09 +00:00
|
|
|
|
}
|