mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
DateLUT: fixed error in prev. revision.
This commit is contained in:
parent
4376d61e89
commit
96dc366b9f
25
libs/libcommon/src/tests/date_lut.cpp
Normal file
25
libs/libcommon/src/tests/date_lut.cpp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <Yandex/DateLUT.h>
|
||||||
|
#include <Yandex/time2str.h>
|
||||||
|
|
||||||
|
|
||||||
|
void loop(time_t begin, time_t end, int step)
|
||||||
|
{
|
||||||
|
Yandex::DateLUTSingleton & date_lut = Yandex::DateLUTSingleton::instance();
|
||||||
|
|
||||||
|
for (time_t t = begin; t < end; t += step)
|
||||||
|
std::cout << Yandex::Time2Sql(t)
|
||||||
|
<< ", " << Yandex::Time2Sql(date_lut.toTimeInaccurate(t))
|
||||||
|
<< ", " << date_lut.toHourInaccurate(t)
|
||||||
|
<< std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char ** argv)
|
||||||
|
{
|
||||||
|
loop(Yandex::OrderedIdentifier2Date(20101031), Yandex::OrderedIdentifier2Date(20101101), 15 * 60);
|
||||||
|
loop(Yandex::OrderedIdentifier2Date(20100328), Yandex::OrderedIdentifier2Date(20100330), 15 * 60);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user