*! version 1.0.0 21 Apr 2026

Title

whatmin -- Convert a clock time into minute-of-day format

Syntax

whatmin clocktime, dst(string)

clocktime clock time to be converted, written as HH:MM

dst(string) diary start time, written as HH:MM; required

Description

whatmin converts a clock time such as 18:30 or 07:45 into the minute-of-day format used by the time-use commands in this toolkit.

The returned value is expressed relative to the diary start time given in dst().

This is useful when you want to know what minute value corresponds to a given clock time, for example when defining time windows or checking timing variables.

Arguments

clocktime is the clock time to convert, written in HH:MM format.

dst(string) specifies the diary start time, also written in HH:MM format.

Important note on dst()

In this command, dst() must be written as a clock string, for example:

dst(04:00)

dst(00:00)

This differs from several other commands in the toolkit, where diary start time is given as an integer hour such as dst(4).

Be careful: writing dst(4) here is not the same thing and may lead to errors.

How the command works

whatmin compares the supplied clock time to the diary start time and returns the number of minutes since the diary began.

If the clock time is earlier than the diary start time, it is treated as belonging to the following calendar day.

Examples

Example 1: Convert an evening time in a diary starting at 04:00

. whatmin 18:30, dst(04:00)

This returns the minute value corresponding to 18:30 in a diary that starts at 04:00.

Example 2: Convert a time after midnight

. whatmin 01:00, dst(04:00)

Because 01:00 is earlier than 04:00, it is treated as the following day.

Remarks

1. Use HH:MM format

Both the target time and dst() should be written in standard clock format such as 04:00 or 18:30.

2. Useful for defining time windows

This command is handy when you want to translate clock times into minute cutoffs for data work.

3. Companion command

Use whattime for the reverse operation: converting a minute-of-day value back into a clock time.

Stored results

whatmin does not store results in r() or e(). It displays the converted minute value in the Results window.

Author

Juana Lamote de Grignon-Pérez

Centre for Time Use Research (CTUR)

Also see

whattime for converting minute-of-day values back into clock time.