UPDATE_SECOND
The function UPDATE_SECOND changes the value of the second in a Time or DateTime into another specified number.
This function takes two pieces of input: a Time or a DateTime, and a Number. It outputs the given Time or Datetime with the value of the second replaced by the given number.
Declaration
Parameters
datetime (type: DateTime)
Any DateTime.
time (type: Time)
Any Time.
new_second (required, type: Number)
The new second; this is the number that will replace whatever value is currently associated with the second in the given Time or DateTime.
Return Values
new_datetime (type: DateTime)
The DateTime that results from taking the given DateTime and replacing the second value with the given number.
new_time (type: Time)
The Time that results from taking the given Time and replacing the second value with the given number.
Examples
Assume the first example has access to the following DateTime value:
The following example takes the time described in example_date_and_time and replaces the given second value (38) with 2. Note that the only difference between the output of this example and example_date_and_time is the the value of the second. When given a DateTime as input, UPDATE_SECOND returns a DateTime:
The above example demonstrates how the UPDATE_SECOND function behaves when given a DateTime as input. In order to further establish how the UPDATE_SECOND function behaves when given a Time as input, assume the last example has access to the following Time value:
The following example takes the time described in example_time and replaces the given second value (38) with 2. Note that the only difference between the output of this example and example_time is the the value of the second. When given a Time as input, UPDATE_SECOND outputs a Time:
Last updated