Skip to main content

Date and time operations

Learn how to convert date and time in Tines

Written by Jamie Gaynor
Updated over 2 weeks ago

What timezone does DATE("now") function return?

DATE("now") will return a UTC time.

Read about the DATE function in our docs.

You can find an example of DATE function uses in the story library

How can I convert timezones in Tines?

There are two examples in the action below,

  • UTC to PST (28800 seconds difference)

  • UTC to PDT (25200 seconds difference)

You can copy/paste the below code into your story board:

{"standardLibVersion":"20","actionRuntimeVersion":"4","agents":[{"disabled":false,"name":"Timezone","description":null,"options":"{\"mode\":\"message_only\",\"PST\":\"<<DATE(\\\"now\\\", \\\"%s\\\") |> MINUS(%, 28800) |> DATE(%, \\\"%Y-%m-%dT%H:%M:%S\\\")>>\",\"PDT\":\"<<DATE(\\\"now\\\", \\\"%s\\\") |> MINUS(%, 25200) |> DATE(%, \\\"%Y-%m-%dT%H:%M:%S\\\")>>\"}","position":{"x":705,"y":780},"type":"eventTransformation","timeSavedUnit":"minutes","timeSavedValue":0,"monitorAllEvents":false,"monitorFailures":false,"monitorNoEventsEmitted":null,"spotlightTemplate":null,"spotlightWriters":[],"form":null,"cardIconName":null,"cardIconColor":null,"createdFromTemplateGuid":null,"createdFromTemplateVersion":null}],"links":[],"diagramNotes":[]}

Converting time into UNIX or epoch time

To convert time into UNIX time, use the function DATE("now", "%s")

To learn more about the date function, see here

You can find an example of DATE function in the story library

Did this answer your question?