Prototype: strtotime(date_string)

Return type: int

Description: Parses a date_string to the number of seconds since the Epoch

Arguments:

  • date_string: string - String to parse - in the range: .*

The function uses under the hood date --date <str> +%s from GNU coreutils, located at /var/cfengine/bin/date

Example:

bundle agent main
{
  vars:
    "next_monday" int => strtotime("next Monday");
}

See also:

History:

  • Introduced in 3.29.0