UPDATE_DATETIME
The function UPDATE_DATETIME replaces the date and time described by a DateTime with another specified Date and Time.
This function takes three pieces of input: a base DateTime, a Date and a Time. It outputs a DateTime with the date and time information replaced by the information given in the given Date and Time. This function also provides the option to declare a change in timezone in the form of a string.
Declaration
Parameters
base_datetime (required, type: Datetime) Any datetime.
new_date (required, type: Date) The new date.
new_time (required, type: Time) The new time.
new_time_zone (optional, type: string) The new timezone. Timezones must be described by their TZ database names, or UPDATE_DATETIME will not parse them as meaningful timezones.
Return Values
datetime (type: DateTime) The DateTime that results from replacing the date and time information in the given DateTime with given Date and Time. If a new timezone is given, this will also be taken into account.
Examples
Assume the example has access to the following DateTime, Date, and Time values:
The following example takes the date and time information given by example_date_and_time, and replaces them it with the information given by example_date and example_time:
UPDATE_DATETIME also provides the option to specify a timezone change by entering a string representing TZ database name. The following example takes the same DateTime, Date, and Time input as the example above, but it also specifies a value for new_time_zone. The timezone specified, "Africa/Addis_Ababa", is three hours ahead of UTC. Note how this changes the hour value as compared to the above example:
Last updated