For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Open sourceSupportFAQsDocs Home
DocumentationAPI referenceRelease notes
DocumentationAPI referenceRelease notes
  • Platform On-Prem
    • Overview
    • Navigate
    • Search resources
  • Apps
      • Overview
      • Navigate
        • Configure and manage tasks
        • Null vs. undefined values
        • Parallel branches
          • Overview
          • addDuration
          • arrayIncludes
          • arrayLastIndexOf
          • arrayPop
          • arrayToString
          • assign
          • calculateTimeDiff
          • charAt
          • charCodeAt
          • childjob
          • codePointAt
          • concat
          • concatArray
          • convertEpochToObject
          • convertTimeFormat
          • convertTimeToEpoch
          • convertTimezone
          • copyWithin
          • csvStringToJSON
          • deepmerge
          • delay
          • endsWith
          • ErrorHandling
          • evaluation
          • eventListenerJob
          • excelToJson
          • extractField
          • fill
          • FlattenJSONFormInput
          • getTime
          • includes
          • arrayIndexOf
          • indexOf
          • isArray
          • join
          • keys
          • lastIndexOf
          • length
          • length (string)
          • localeCompare
          • makeData
          • map
          • match
          • merge
          • modify
          • newVariable
          • normalize
          • objectHasOwnProperty
          • objectToString
          • padEnd
          • padStart
          • parse
          • parseInt
          • pop
          • push
          • pushToArray
          • query
          • repeat
          • restCall
          • reverse
          • runCode
          • search
          • setObjectKey
          • shift
          • slice (array)
          • slice (string)
          • sort
          • split
          • startsWith
          • stringValueOf
          • stub
          • substring
          • toLocaleLowerCase
          • toLocaleString
          • toLocaleUpperCase
          • toLowerCase
          • numberToString
          • toString (array)
          • toString (number)
          • toString (object)
          • toUpperCase
          • transformation
          • trim
          • trimEnd
          • trimStart
          • unshift
          • updateJobDescription
          • values
          • viewData
    • FlowAI
    • Itential Automation Gateway
  • Resources
    • Itential Academy
    • Version lifecycle
    • Itential MCP
    • Accessibility conformance
    • Get support
    • FAQs
LogoLogo
Open sourceSupportFAQsDocs Home
On this page
  • Potential use case
  • Properties
  • Input variables
  • Output variables
  • Example 1
  • Example 2
  • Example 3
AppsStudioTasksTask reference

convertEpochToObject

Was this page helpful?
Previous

convertTimeFormat

Next
Built with

The convertEpochToObject task converts an Epoch timestamp into a date string with a specified time and date format.

Potential use case

Suppose you have a northbound system that is only capable of providing an Epoch timestamp. The convertEpochToObject task allows you to convert it into a human-readable timestamp for log files or other event records.

Properties

Input variables

IncomingTypeDescriptionExample
epochNumberRequired. The Epoch timestamp to convert. Epoch timestamps are defined as the number of seconds or milliseconds that have elapsed since midnight UTC on January 1st, 1970.1688050800
epochFormatEnumRequired. The format of the epoch timestamp value. Allowed values are Seconds or Milliseconds.Seconds
newFormatStringStringOptional. The moment.js format of the converted epoch value.YYYY-MM-DDTHH:mm:ss.SSSSSSZZ

Output variables

OutgoingTypeDescription
convertedTimeObjectThe converted time value, presented in the format specified by the newFormatString parameter.

Example 1

In this example:

  • The epoch variable is provided by the output of the reference task convertTimeToEpoch, which is located elsewhere in the workflow.

    The convertTimeToEpoch task was used only to simulate an incoming Epoch timestamp for this example.

  • The reference variable provided by the convertTimeToEpoch task is epochTime.

  • The EpochFormat variable is set to Seconds.

  • The newFormatString variable is set to LLL, which is the moment.js locale format for Month name, day of month, year, time.

  • The convertedTime produced upon output will be the value of the epoch timestamp presented in a human-readable format.

convertEpochToObject task configured with LLL format string

Example 2

In this example:

  • The epoch variable is provided by the output of the reference task convertTimeToEpoch, which is located elsewhere in the workflow.

    The convertTimeToEpoch task was used only to simulate an incoming Epoch timestamp for this example.

  • The reference variable provided by the convertTimeToEpoch task is epochTime.

  • The EpochFormat variable is set to Seconds.

  • The newFormatString property is set to DD-MMM-YY hh:mm a, which is a date time format for Day-Month-Year hour:min am/pm.

  • The convertedTime produced upon output will be the value of the epoch timestamp presented in a human-readable format.

convertEpochToObject task configured with DD-MMM-YY hh:mm a format string

Example 3

In this example:

  • The epoch property is statically set to the number 1591045860.
  • The EpochFormat property is set to Seconds.
  • The newFormatString property is set to DD-MMM-YY hh:mm a, which is a date time format for Day-Month-Year hour:min am/pm.
  • The convertedTime produced upon output will be the value of the epoch timestamp presented in a human-readable format. In this case the converted timestamp will be 01-Jun-20 09:11 pm.
convertEpochToObject task with static epoch value of 1591045860