Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions content/reference/functions/strtotime.markdown
Original file line number Diff line number Diff line change
@@ -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 <str> +%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
Loading