2011-01-21 21:38:02 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
#include <Yandex/DateLUT.h>
|
|
|
|
#include <Yandex/time2str.h>
|
|
|
|
|
|
|
|
|
|
|
|
void loop(time_t begin, time_t end, int step)
|
|
|
|
{
|
2014-07-08 23:52:53 +00:00
|
|
|
DateLUT & date_lut = DateLUT::instance();
|
2011-01-21 21:38:02 +00:00
|
|
|
|
|
|
|
for (time_t t = begin; t < end; t += step)
|
2013-08-11 03:40:14 +00:00
|
|
|
std::cout << Time2Sql(t)
|
|
|
|
<< ", " << Time2Sql(date_lut.toTimeInaccurate(t))
|
2011-01-21 21:38:02 +00:00
|
|
|
<< ", " << date_lut.toHourInaccurate(t)
|
|
|
|
<< std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char ** argv)
|
|
|
|
{
|
2013-08-11 03:40:14 +00:00
|
|
|
loop(OrderedIdentifier2Date(20101031), OrderedIdentifier2Date(20101101), 15 * 60);
|
|
|
|
loop(OrderedIdentifier2Date(20100328), OrderedIdentifier2Date(20100330), 15 * 60);
|
2014-11-06 02:39:48 +00:00
|
|
|
loop(OrderedIdentifier2Date(20141020), OrderedIdentifier2Date(20141106), 15 * 60);
|
2011-01-21 21:38:02 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|