My Digital Garden

Converting UTC Date Time to UNIX Time With Power Automate

Converting UTC Date Time to UNIX Time With Power Automate (ryanmaclean365, 2020)

rw-book-cover

Metadata

  • Author: ryanmaclean365
  • Full Title: Converting UTC Date Time to UNIX Time With Power Automate
  • Category: #articles
  • Document Note: The text explains how to convert a UTC datetime to Unix time using Power Automate. Unix time is the number of seconds that have passed since 00:00:00 UTC on January 1, 1970. The solution involves a series of steps to calculate the elapsed time in seconds between the Unix epoch and the desired datetime.
  • Document Tags: work-todo
  • Summary: The text explains how to convert a UTC datetime to Unix time using Power Automate. Unix time is the number of seconds that have passed since 00:00:00 UTC on January 1, 1970. The solution involves a series of steps to calculate the elapsed time in seconds between the Unix epoch and the desired datetime.
  • URL: https://ryanmaclean365.com/2020/08/03/converting-utc-date-time-to-unix-time-with-power-automate/

Highlights

  • Unix time is a system for describing a point in time; it is the number of seconds that have elapsed since the Unix epoch, minus leap seconds. the Unix epoch is 00:00:00 UTC on 1 January 1970. Leap seconds are ignored with a leap second having the same Unix time as the second before it, and every day is treated as if it contains exactly 86400 seconds. Since we know this, we just need to calculate how many seconds have passed between the Unix epoch and the datetime we want to convert. (View Highlight)
  • The solution is a single Compose action with the following expression: div(sub(ticks(triggerBody()['text']),ticks('1970-01-01Z00:00:00')),10000000) (View Highlight)