Date Functions
1、addToTime(向时间戳添加若干时间单位)
Add a number of time units to a timestamp. For example, addToTime(‘2018-01-01T00:00:00Z’, 1, ‘Day’) results in 2018-01-02T00:00:00.0000000Z
2、adddays(向传入的字符串时间戳添加整数天。天数可以是正值或负值)
Adds an integer number of days to a string timestamp passed in. The number of days can be positive or negative. The result is a string in ISO 8601 format (“o”) by default, unless a format specifier is provided. For example 2015-02-23T13:27:36Z:adddays(‘2015-03-15T13:27:36Z’, -20)
3、addhours(向传入的字符串时间戳添加整数小时数)
Adds an integer number of hours to a string timestamp passed in. The number of hours can be positive or negative. The result is a string in ISO 8601 format (“o”) by default, unless a format specifier is provided. For example 2015-03-16T01:27:36Z:addhours(‘2015-03-15T13:27:36Z’, 12)
4、addminutes(向传入的字符串时间戳添加整数分钟数)
Adds an integer number of minutes to a string timestamp passed in. The number of minutes can be positive or negative. The result is a string in ISO 8601 format (“o”) by default, unless a format specifier is provided. For example, 2015-03-15T14:00:36Z:addminutes(‘2015-03-15T13:27:36Z’, 33)
5、addseconds(向传入的字符串时间戳添加整数秒数)
Adds an integer number of seconds to a string timestamp passed in. The number of seconds can be positive or negative. The result is a string in ISO 8601 format (“o”) by default, unless a format specifier is provided. For example: addseconds(‘2015-03-15T13:27:36Z’, -36) results in 2015-03-15T13:27:00Z
6、convertFromUtc(将时间戳从世界时间(UTC)转换为目标时区)
Convert a timestamp from Universal Time Coordinated (UTC) to the target time zone. For example, convertFromUtc(‘2018-01-01T08:00:00.0000000Z’, ‘Pacific Standard Time’) results in ‘2018-01-01T00:00:00.0000000’
7、convertTimeZone(将时间戳从源时区转换为目标时区)
Convert a timestamp from the source time zone to the target time zone. For example, convertTimeZone(‘2018-01-01T80:00:00.0000000Z’, ‘UTC’, ‘Pacific Standard Time’) results in ‘2018-01-01T00:00:00.0000000’
8、convertToUtc(将源时区的时间戳转换为世界时(UTC))
Convert a timestamp from the source time zone to Universal Time Coordinated (UTC). For example, convertToUtc(‘01/01/2018 00:00:00’, ‘Pacific Standard Time’) results in ‘2018-01-01T08:00:00.0000000Z’
9、dayOfMonth(从时间戳返回月份的日期)
Return the day of the month from a timestamp.
10、dayOfWeek(从时间戳返回星期几。)
Return the day of the week from a timestamp.
11、dayOfYear(从时间戳返回一年中的某一天。)
Return the day of the year from a timestamp.
12、formatDateTime(返回日期格式的字符串)
Returns a string in date format. The result is a string in ISO 8601 format (“o”) by default, unless a format specifier is provided.
13、getFutureTime(返回当前时间戳加上指定的时间单位)
Return the current timestamp plus the specified time units. For example, suppose the current timestamp is ‘2018-03-01T00:00:00.0000000Z’, getFutureTime(5, ‘Day’) results in ‘2018-03-06T00:00:00.0000000Z’.
14、getPastTime(返回当前时间戳减去指定的时间单位)
Return the current timestamp minus the specified time units. For example, suppose the current timestamp is ‘2018-02-01T00:00:00.0000000Z’, getPastTime(5, ‘Day’) results in ‘2018-01-27T00:00:00.0000000Z’.
15、startOfDay(返回一天的开始时间戳)
Return the start of the day for a timestamp.
16、startOfHour(返回时间戳的开始时间)
Return the start of the hour for a timestamp.
17、startOfMonth(返回时间戳的月初。)
Return the start of the month for a timestamp.
18、subtractFromTime(从时间戳中减去若干时间单位)
Subtract a number of time units from a timestamp. For example, subtractFromTime(‘2018-01-02T00:00:00Z’, 1, ‘Day’) results in ‘2018-01-01T00:00:00:0000000Z’.
19、ticks(返回指定时间戳的ticks属性值。A tick是100纳秒的间隔)
Return the ticks property value for a specified timestamp. A tick is a 100-nanosecond interval.
20、utcnow(以字符串形式返回当前时间戳。)
Returns the current timestamp as a string.