> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.itential.com/itential-platform/2023-2/studio/tasks/reference/convert-time-to-epoch/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server. # convertTimeToEpoch > Use the convertTimeToEpoch task to convert a date/timestamp to Epoch Time. The `convertTimeToEpoch` task converts a date/timestamp to Epoch Time — the number of seconds (or milliseconds) elapsed since January 1, 1970 (midnight UTC/GMT). ## Potential use case Use this task when a workflow needs to provide an input timestamp to a downstream interface or system that requires Epoch Time format. ## Properties | Incoming | Type | Description | | :------------ | :----- | :------------------------------------------------------------------------------------------ | | `inputTime` | Object | Required. The date/timestamp to convert. | | `EpochFormat` | Enum | Required. The Epoch format for the output. Allowed values: `"Seconds"` or `"Milliseconds"`. | | Outgoing | Type | Description | | :---------- | :----- | :------------------------------------------------------------------------------------------------------------------------------------- | | `epochTime` | Number | The converted date/timestamp value as seconds or milliseconds since January 1, 1970 (midnight UTC/GMT), as specified by `EpochFormat`. | ## Example 1 In this example: * The `inputTime` variable comes from the `getTime` reference task. The reference variable is `time`. * The `EpochFormat` is set to `Seconds`. * The output `epochTime` will be the `inputTime` value expressed in seconds since January 1, 1970. ![](/_fern-img/05f39ef5a975feaf8c496e3fd1781894775d5446dc1f20d53546889cb7024982.webp) ## Example 2 In this example: * The `inputTime` variable comes from the `getTime` reference task. The reference variable is `time`. * The `EpochFormat` is set to `Milliseconds`. * The output `epochTime` will be the `inputTime` value expressed in milliseconds since January 1, 1970. ![](/_fern-img/1a0c3e3b0199c45573bcb808fb43d930ea3e8d5c6d6f11173f9613ff73595ca6.webp) ## Manual reference variable entry To enter the `inputTime` object manually, use the Year-Month-Date-Time format (`yyyy-MM-dd 'T' HH:mm:ss.SSSZ`): ```json {"time": "2021-02-26T15:00:00.000Z"} ``` This displays as: ``` 2021-02-25 03:00.00 ``` > Use the convertTimeToEpoch task to convert a date/timestamp to Epoch Time.