TimestampOffsetByComponents function

Returns the timestamp, with offsets applied from the base timestamp with year offset, month offset, day offset, hour offset, minute offset, and second offset, each given as separate values.

Namespace

datetime

Input

base timestamp(timestamp|string), year offset(int|long), month offset(int|long), day offset(int|long), hour offset(int|long),minute offset(int|long), seconds offset(int|long)

Output

timestamp(timestamp)

Example

If basetimestamp contains 2009-08-18 14:05:29 and yearoffset contains 0monthsoffset contains the value 2daysoffset contains the value -4hoursoffset contains the value 2minutessoffset contains the value 0secondsoffset contains the value 20, then the two following functions are equivalent, and return the timestamp 2009-10-14 16:05:49.

set-column result datetime:TimestampOffsetByComponents('2009-08-18 14:05:29', 0, 2, -4, 2, 0, 20) set-column result datetime:TimestampOffsetByComponents(basetimestamp, yearoffset, monthoffset, dayoffset, hoursoffset, minutesoffset, secondsoffset)

 

Created in 2020 by Google Inc.