time function

The time function composes a time starting from hours, minutes and seconds strings.

While the hour function extracts the time from a datetime attribute, the time function builds the time by merging strings coming from different columns.


Parameters

time(hour, minute, second)

Parameter

Description

hour

The attribute containing the hour as an integer number. The hour parameter is mandatory.

minute

The attribute containing the minute as an integer number.

second

The attribute containing the second as a continuous number.

Integer type valid formats (if the values aren’t this format, the function will return an error).

  • 45;

  • -44

Continuous type valid formats (if the values aren’t this format, the function will return an error).

  • 34.000;

  • 34563.876


Example

The following example uses the Instagram_data dataset.

Description

Screenshot

In this example, we want to create a new attribute which merges the Hour and Minute attributes.

We add a new attribute, called Time, and type the following formula:

time($"Hour",$"Minute")

and the attribute is filled with the time.