find dates
Do no think about next Friday night attending this function and then calling for 'sleep until()'!
Let's keep our head and hands in front of our computer, at least for now.
This function checks the input parameter, which can be a single value or a set containing values, for dates and retuns them in a set containing all identified dates. Dates identified in string
will be converted to dates. In order to avoid regional ambiguities, only strict date and/or time formats are allowed:
All other values, including blank dates, will be discarded. The key benefit here is to gather all dates in tables across one or multiple columns keeping all blank and garbage contents outside.
1-2
No. | Type | Description |
---|---|---|
1 input |
all types | Target date / time This parameter will be searched for date and time values. It may contain single values, sets and nested sets of any depth. All elements will be checked for dates and time info. |
2 input |
string | Option Following options are supported:
|
a[]= find dates( { "2025-08-01", date(''), Coffee time, date(today), time("10:15:30"), date("2025-03-03 12:01:02") }, all );
b[]= find dates( { "2025-08-01", date(''), Coffee time, date(today), time("10:15:30"), date("2025-03-03 12:01:02") }, date );
c[]= find dates( { "2025-08-01", date(''), Coffee time, date(today), time("10:15:30"), date("2025-03-03 12:01:02") }, time );
d[]= find dates( { "2025-08-01", date(''), Coffee time, date(today), time("10:15:30"), date("2025-03-03 12:01:02") }, date time );
e[]= find dates( { "2025-08-01", date(''), Coffee time, date(today), time("10:15:30"), date("2025-03-03 12:01:02") }, contains date );
f[]= find dates( { "2025-08-01", date(''), Coffee time, date(today), time("10:15:30"), date("2025-03-03 12:01:02") }, contains time );
echo("any: ", a[]);
echo("date: ", b[]);
echo("time: ", c[]);
echo("date time: ", d[]);
echo("contains date: ", e[]);
echo("contains time: ", f[]);
any: {'2025-08-01','2025-09-21','10:15:30','2025-03-03 12:01:02'}
date: {'2025-08-01','2025-09-21'}
time: {'10:15:30'}
date time: {'2025-03-03 12:01:02'}
contains date: {'2025-08-01','2025-09-21','2025-03-03 12:01:02'}
contains time: {'10:15:30','2025-03-03 12:01:02'}