TIME
A time from hours, minutes and seconds; past a day the hours wrap round.
Group: Date and time. Compatible with DAX.
Syntax
TIME ( <hour>, <minute>, <second> )
| Parameter | Type | Description |
|---|---|---|
hour | Whole number | The hour, 0 to 23; past 23 it wraps round past midnight. |
minute | Whole number | The minutes; 60 or more carry into the hours. |
second | Whole number | The seconds; 60 or more carry into the minutes. |
Returns
Date and time. That time of day, on 30 December 1899, day 0 of the date numbers.
Remarks
- A time is a fraction of a day: 12:00 is 0.5. Add it to a date for a date with a time, as
DATE ( 2024, 3, 15 ) + TIME ( 14, 30, 0 ). - Past 24 hours the whole days are dropped:
TIME ( 25, 0, 0 )is 01:00. - Each argument must lie between −32768 and 32767, so
TIME ( 0, 0, 86399 )is an error: writeTIME ( 23, 59, 59 ). The total must not be negative either:TIME ( 1, -30, 0 )is 00:30, butTIME ( -1, 0, 0 )is an error. - A decimal is rounded, and a blank counts as 0.
Examples
Carrying over
EVALUATE
ROW (
"25 hours", TIME ( 25, 0, 0 ),
"90 minutes past noon", TIME ( 12, 90, 0 ),
"3600 seconds", TIME ( 0, 0, 3600 )
)
| 25 hours | 90 minutes past noon | 3600 seconds |
|---|---|---|
| 1899-12-30 01:00:00 | 1899-12-30 13:30:00 | 1899-12-30 01:00:00 |
A shift and its length
The difference of two times is in days; times 24, in hours.
EVALUATE
ROW (
"Start", DATE ( 2024, 3, 15 ) + TIME ( 8, 0, 0 ),
"End", DATE ( 2024, 3, 15 ) + TIME ( 16, 30, 0 ),
"Hours", ( TIME ( 16, 30, 0 ) - TIME ( 8, 0, 0 ) ) * 24
)
| Start | End | Hours |
|---|---|---|
| 2024-03-15 08:00:00 | 2024-03-15 16:30:00 | 8.5 |