当前位置:K88软件开发文章中心大数据Apache Pig → 文章内容

Apache Pig 日期时间函数

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-26 10:03:57

由 jarodhu 创建,youj 最后一次修改 2016-12-28 Apache Pig提供以下日期和时间函数 - S.N.函数 & 描述1ToDate(milliseconds)此函数根据给定的参数返回日期时间对象。此函数的另一个替代方法是ToDate(iosstring),ToDate(userstring,format),ToDate(userstring,format,timezone)2CurrentTime()返回当前时间的日期时间对象。3GetDay(datetime)从日期时间对象返回一个月中的某一天。4GetHour(datetime)从日期时间对象返回一天中的小时。5GetMilliSecond(datetime)从日期时间对象返回秒中的毫秒。6GetMinute(datetime)从日期时间对象返回一小时中的分钟。7GetMonth(datetime)从日期时间对象返回一年中的月份。8GetSecond(datetime)从日期时间对象返回一分钟的秒。9GetWeek(datetime)从日期时间对象返回一年中的周。10GetWeekYear(datetime)从日期时间对象返回周年。11GetYear(datetime)从日期时间对象返回年份。12AddDuration(datetime, duration)返回日期时间对象的结果以及持续时间对象。13SubtractDuration(datetime, duration)从Date-Time对象中减去Duration对象并返回结果。14DaysBetween(datetime1, datetime2)返回两个日期时间对象之间的天数。15HoursBetween(datetime1, datetime2)返回两个日期时间对象之间的小时数。16MilliSecondsBetween(datetime1, datetime2)返回两个日期时间对象之间的毫秒数。17MinutesBetween(datetime1, datetime2)返回两个日期时间对象之间的分钟数。18MonthsBetween(datetime1, datetime2)返回两个日期时间对象之间的月数。19SecondsBetween(datetime1, datetime2)返回两个日期时间对象之间的秒数。20WeeksBetween(datetime1, datetime2)返回两个日期时间对象之间的周数。21YearsBetween(datetime1, datetime2)返回两个日期时间对象之间的年数。

Apache Pig 日期时间函数