il_random_datetime()
Generate a random datetime between two datetimes.
Syntax
il_random_datetime(start, end)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
start |
string | yes | Start datetime, YYYY-MM-DD HH:MM:SS. |
end |
string | yes | End datetime, YYYY-MM-DD HH:MM:SS. |
Returns
A datetime string, YYYY-MM-DD HH:MM:SS.
Example
record_create("logs", [
"at" => il_random_datetime("2026-06-01 00:00:00", "2026-06-30 23:59:59")
]);
Example output
"2026-06-18 14:23:51"
Notes
- For testing only.
See also: il_random_date()