Apache Pig提供以下日期和时间函数 :
SN | 功能&描述 |
---|---|
1 | ToDate(milliseconds) 此函数根据给定的参数返回日期时间对象.此函数的另一个替代方法是ToDate(iosstring),ToDate(用户字符串,格式),ToDate(用户字符串,格式,时区) |
2 | CurrentTime() 返回当前时间的日期时间对象. |
3 | GetDay(datetime) 从日期时间对象返回一个月中的某一天. |
4 | GetHour(datetime) 从日期时间对象返回一天中的小时. |
5 | GetMilliSecond( datetime) 返回日期时间对象的毫秒数. |
6 | GetMinute(datetime) 返回分钟距日期时间对象一小时. |
7 | GetMonth(datetime) 从日期时间对象返回一年中的月份. |
8 | GetSecond(datetime) 返回日期时间对象中的第二分钟. |
9 | GetWeek(datetime) 从日期时间对象返回一年中的一周. |
10 | GetWeekYear(datetime) 返回从date-ti开始的一周我反对. |
11 | GetYear(datetime) 从日期时间对象返回年份. |
12 | AddDuration( datetime,duration) 返回日期时间对象的结果以及持续时间对象. |
13 | SubtractDuration(datetime,duration) 从Date-Time对象中减去Duration对象并返回结果. |
14 | DaysBetween(datetime1,datetime2) 返回两个日期时间对象之间的天数. |
15 | HoursBetween(datetime1,datetime2) 返回两个日期时间对象之间的小时数. |
16 | MilliSecondsBetween(datetime1,datetime2) 返回两个日期时间对象之间的毫秒数. |
17 | MinutesBetween(datetime1, datetime2) 返回两个日期时间对象之间的分钟数. |
18 | MonthsBetween(datetime1,datetime2) 返回两个日期时间对象之间的月数. |
19 | SecondsBetween(datetime1,datetime2) 返回两个日期时间对象之间的秒数. |
20 | WeeksBetween(datetime1, datetime2) 返回两个日期时间对象之间的周数. |
21 | YearsBetween(datetime1,datetime2) 返回两个日期时间对象之间的年数. |