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.

Call as: function

Restrictions

Indirect parameter passing is disabled

Parameter count

1

Parameters

No.TypeDescription
1
input
date or string converted to date Date value to check

Value to check.

Return value

TypeDescription
boolean 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 parameters( 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