hive函数返回错误的日期

时间:2017-12-05 22:06:29

标签: sql hive

hive> select from_unixtime(UNIX_TIMESTAMP('02/31/17', "mm/dd/yy"),'yyyy-MM-dd') from dual;
OK
2017-01-31

它正在回复日期。

1 个答案:

答案 0 :(得分:0)

找到它。日期格式错误。

#include <iostream>
#include <iomanip>

using namespace std;

int main ()
{
    char st[15] = "United Kingdom";

    cout << setw(15) << st << '\n'; // prints " United Kingdom"
    cout << setw(5) << st << '\n'; // prints "United Kingdom"
    cout << setw(15) << string(st, 6) << '\n'; // prints "         United"
    cout << left << setw(15) << string(st, 6) << '\n'; // prints "United         "
    cout << setw(15) << string(st, 0) << '\n'; // prints "               "
    cout << string(st, 3) << '\n'; // prints "Uni"
    cout << st << '\n; // prints "United Kingdom"

    return 0;
}