serial date

Prev Next

Function Names

serial date, serial date time

Description

These functions converts a date to serial date as used in Microsoft Excel. The serial date begins on 01.01.1990 with value 1. 0 is returned for values without recognizabale date. The value is always an integer and does not include any time-of-day offset.

  • serial date returns the date only, i.e. the value is always a whole number.
  • serial date time returns values comprising of dates (whole number part) and times (fractional part) For example, a date with time = 06:00:00 in the morning ends with .25.



Vectorization: This function supports 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

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 used, then a set containing multiple values is returned.

Examples

               echo( serial date( 18.06.2020 ), ", ", serial date( "18.06.2020 18:00" ), ", ",
                     serial date( 01.01.1990 ), ", ", serial date( "" ) );
               echo( serial date time ( { 18.06.2020, "18.06.2020 18:00" , 01.01.1990, "", "12:00" } ) ); // Vectorization

Output

44000, 44000, 32874, 0
{44000,44000.75,32874,0,0.5}
Try it yourself: Open LIB_Function_serial_date.b4p in B4P_Examples.zip. Decompress before use.

See also

Date info functions