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

When defining times, there are a number of functions that can be used to perform calculations and tests on the times. The examples below assume a respondent's answer to q1b is 8.30.52pm and the answer to q1c was 9.45pm

Function

Interpretation

Example

{time}<, <=, =, ==, <>, >=, > {time}

Shows whether or not a time response fits into the category specified.

The expression q1b<8.31 pm in a code list would include our example response.

{time}-{quantity}

Gives a time, calculated from an existing time variable and a quantity variable.

The expression q1c-3600 would result in 8.45 (an hour before the respondent left).

{time} + {quantity}

Gives a time, calculated from an existing time variable and a quantity variable.

The expression q1b + 10800 would produce 11.30.52 (three hours later than the respondent arrived).

hour

Gives the hour in which the time occurs. Use 24 hour clock only when specifying code values.

The result of Q1b hour would be the number 20.

minute

Gives the minutes part of the time only.

The result of Q1b minute would be the number 30.

 

second

Gives the seconds part of the time only.

The result of Q1b second would be the number 52.

See Also

Using time data

Time format examples

Categorising time responses using a single derived variable

Categorising time responses using a time function

Calculating the interval between two times using time variables