This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help

Next Topic

Book Contents

Book Index

Time Functions

A Time Function is used to extract parts of a time for use in other expressions or for analysis or reporting. To use a time function with a time variable, type the variable name followed with the function name.

For example, to determine the hour of the day represented by the response to variable Q1b, use:

Q1b HOUR

At least one space must be left between the function name and variable name.

When defining times, there are a number of functions that can be used to extract parts of a time. All examples given below assume that this respondent's answer to the time variable Q1b, 'What time did you arrive?', is 10.30.52 pm.

Function

Description

Example

hour

Gives the hour in which the time occurs.

The result of Q1b hour would be the number 22.

minute

Gives the minutes part of the time.

The result of Q1b minute would be the number 30.

 

second

Gives the seconds part of the time.

The result of Q1b second would be the number 52.

See Also

Time operators