hour, minute, second

Prev Next

Function Names

hour, minute, second

Description

These functions extract specific numeric info of the times. 0 is returned if the input value contains no recognizable time.

Function Name Result
hour hour 0-23
minute minute 0-59
second second 0-59



Vectorization: These functions support vectorization in the 1st function parameter. Instead of providing a single value, you can provide a set or even a nested set which contain multiple values. The function will then process every value and its return value contains a corresponding set containing all results.

Call as: function

Restrictions

Indirect parameter passing is disabled
Vectorization is allowed in the 1st function parameter

Parameter count

1

Parameters

No.TypeDescription
1
input
date or string converted to date
set
Date with time info

Value to extract as described above. Vectorization: Put multiple values into a (nested) set.

Return value

TypeDescription
numeral
set
Result

Returned value as described above. If vectorization is applied, then the function returns a set containing mulitple values.

Examples

               a[] = "14. July 2020, 15:30:40";
               echo( hour( a[] ), ", ", minute( a[] ), ", ", second( a[] ) );
               echo( hour( { a[], "12:00" } ) ); // Vectorization: 2 values

Output

15, 30, 40
{15,12}
Try it yourself: Open LIB_Function_hour.b4p in B4P_Examples.zip. Decompress before use.

See also

Date info functions