date inside, time inside

Prev Next

Function Names

date inside, time inside

Description

Checks if the variable contains a date or time information.

  • date inside: At last an incomplete date must be recognized (e.g. "April 2022").
  • time inside: At least hour and minute must be recognized
  • full date inside: A full date must be recognized (e.g. 2022-04-01)
  • full time inside: A full time (hour, minute, second) must be recognized.



Vectorization: These function 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 value to check

Value to check. Vectorization: Specify multiple parameters into a (nested) set

Return value

TypeDescription
boolean
set
Result

Function date inside returns true if the variable contains a date.
Function time inside returns true if the variable contains a time.

Examples

               dates[] = { "2020-01-01", today, "2020-01-01 13:00:00", now, "13:00:00", time(now), "", date("") };
               for all( dates[], date[] ) echo( date inside(date[]), " / ", time inside(date[]) );

Output

true / false
true / false
true / true
true / false
false / true
false / true
false / false
false / false
Try it yourself: Open LIB_Function_date_inside.b4p in B4P_Examples.zip. Decompress before use.

See also

describe