SECOND( ) function

Extracts the seconds from a specified time or datetime and returns it as a numeric value.

Syntax

SECOND(time/datetime)

Parameters

time/datetime

Datetime. The field, expression, or literal value to extract the seconds from.

Output

Numeric.

Remarks

A field specified for the time/datetime parameter can use any time or datetime format, as long as the field definition correctly defines the format.

When specifying a literal time or datetime value for the time/datetime parameter, you are restricted to the formats in the table below, and you must enclose the value in backquotes – for example, `20141231 235959`. For datetime values, you can use any combination of date, separator, and time formats. The date must precede the time, and you must use a separator between the two. For time values, you can use any combination of separator and time formats. You must use a separator before the time value for the function to operate correctly. Times must be specified using the 24-hour clock. Offsets from Coordinated Universal Time (UTC) must be prefaced by a plus sign (+) or a minus sign (-). Do not use any separators such as slashes (/) or colons (:) between the individual components of dates or times.

Date formats

Separator formats

Time formats

Examples

YYYYMMDD

single blank space

hhmmss

`20141231 235959`

YYMMDD

the letter ‘t’

hhmm

`141231 2359`

the letter ‘T’

hh

`141231t23`

 

+/-hhmm

(UTC offset)

`141231t235959-0500`

+/-hh

(UTC offset)

`141231T2359+01`

(Note: Do not use hh alone in the main time format with data that has a UTC offset. For example, avoid: hh+hhmm. Results can be unreliable.)

`t235959`

Examples

Example Return value

SECOND(`t235930`)

30

SECOND(`20141231 235930`)

30

SECOND(Call_start_time)

The seconds for each value in the Call_start_time field

SECOND(Receipt_timestamp)

The seconds for each value in the Receipt_timestamp field

Related reference
MINUTE( ) function
HOUR( ) function


(C) 2013 ACL Services Ltd. All Rights Reserved. | Send feedback