From 0344921485a04722f484ca057de1c90f17bdb134 Mon Sep 17 00:00:00 2001 From: Victor Moene Date: Wed, 26 Aug 2026 11:27:52 +0200 Subject: [PATCH] Added docs entry for strtotime function Signed-off-by: Victor Moene --- .../reference/functions/strtotime.markdown | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 content/reference/functions/strtotime.markdown 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