Skip to main content

asMonths

Converts a duration from seconds to months.

Parameters

  • DURATION (number)

    The number of seconds to convert.

  • START DATETIME (datetime or string)

    Optional. The duration is calculated forward from this date.

    Input a datetime object or a string in an automatically recognized datetime pattern.

    Default: 1970-01-01

  • END DATETIME (datetime or string)

    Optional. The duration is calculated backward from this date when no start date is specified.

    Input a datetime object or a string in an automatically recognized datetime pattern.

Examples

ATL in Script

Result

Notes

[[asMonths(2678400)]]

1

2678400 = 31 days in seconds. This converts to 1 month when counting forward from Jan 1, 1970 (default value).

[[asMonths(2678400, '2019-02-01')]]

1.1

2678400 = 31 days in seconds. This converts to 1.1 months when counting forward from a start date of Feb 1, 2019.

[[asMonths(2678400, '', '2019-02-01')]]

1

2678400 = 31 days in seconds. This converts to 1 month when counting backward from an end date of Feb 1, 2019.

Note

The END DATETIME value is ignored when a START DATETIME is specified.