- Apache Pig 教程
- Apache Pig - 首页
- Apache Pig 简介
- Apache Pig - 概述
- Apache Pig - 架构
- Apache Pig 环境
- Apache Pig - 安装
- Apache Pig - 执行
- Apache Pig - Grunt Shell
- Pig Latin
- Pig Latin - 基础
- 加载 & 存储操作符
- Apache Pig - 读取数据
- Apache Pig - 存储数据
- 诊断操作符
- Apache Pig - 诊断操作符
- Apache Pig - Describe 操作符
- Apache Pig - Explain 操作符
- Apache Pig - Illustrate 操作符
- 分组 & 连接
- Apache Pig - Group 操作符
- Apache Pig - Cogroup 操作符
- Apache Pig - Join 操作符
- Apache Pig - Cross 操作符
- Pig Latin 内置函数
- Apache Pig - Eval 函数
- 加载 & 存储函数
- Apache Pig - Bag & Tuple 函数
- Apache Pig - 字符串函数
- Apache Pig - 日期时间函数
- Apache Pig - 数学函数
- Apache Pig 有用资源
- Apache Pig - 快速指南
- Apache Pig - 有用资源
- Apache Pig - 讨论
Apache Pig - 日期时间函数
Apache Pig 提供以下日期和时间函数:
| 序号 | 函数 & 描述 |
|---|---|
| 1 | ToDate(milliseconds)
此函数根据给定的参数返回一个日期时间对象。此函数的其他替代方案为 ToDate(iosstring)、ToDate(userstring, format)、ToDate(userstring, format, timezone) |
| 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)
从日期时间对象中返回星期年。 |
| 11 | GetYear(datetime)
从日期时间对象中返回年份。 |
| 12 | AddDuration(datetime, duration)
返回日期时间对象加上持续时间对象的计算结果。 |
| 13 | SubtractDuration(datetime, 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)
返回两个日期时间对象之间的年数。 |
广告