second function in the Factory

The second function returns the seconds (values) of the time values.


Parameters

second(time)

Parameter

Description

time

The datetime or time attribute from which we want to retrieve the second. The time parameter is mandatory.

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

  • 2019/05/22 17:33:45

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

  • 17:27:35;

  • 17:27:35.120;

  • 17:27


Example

The following example uses the Instagram_data dataset.

Description

Screenshot

In this example, we want to retrieve the seconds of the Date Posted attribute, in which the date and time are contained.

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

second($"Date Posted")

and the attribute is filled with the seconds of the Date Posted attribute.