diff --git a/content/reference/functions/strtotime.markdown b/content/reference/functions/strtotime.markdown new file mode 100644 index 000000000..0dc53f754 --- /dev/null +++ b/content/reference/functions/strtotime.markdown @@ -0,0 +1,33 @@ +--- +layout: default +title: strtotime +aliases: + - "/reference-functions-strtotime.html" +--- + +{{< CFEngine_function_prototype(date_string) >}} + +**Description:** Parses a `date_string` to the number of seconds since the Epoch + +{{< CFEngine_function_attributes(date_string) >}} + +The function uses under the hood `date --date +%s` from GNU coreutils, located at `/var/cfengine/bin/date` + +**Example:** + +```cf3 +bundle agent main +{ + vars: + "next_monday" int => strtotime("next Monday"); +} +``` + +**See also:** + +- Related functions + - [`strftime()`][strftime] + +**History:** + +- Introduced in 3.29.0