web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How can I make an expr...
Power Automate
Unanswered

How can I make an expresion that convert to Epoch time (Seconds since 1970-01-01)?

(0) ShareShare
ReportReport
Posted on by 43

I'm making a flow where I need a time in Epoc time, but I can't figure out how to make an expression that do this.

As a work around I made it in my data set from SQL view where I added a column DATEDIFF(s, '1970-01-01 00:00:00', GETUTCDATE()) as Epoch.

But I can't find a flow expression in flow that do the same as SQL's datediff. 

Categories:
I have the same question (0)
  • Verified answer
    ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @JBille

    Flow does not have a datediff expression - you'll want to use the ticks expression to convert date/times and then do some math.

    Here is a link to a post with a similar issue to get you started.

     

     

     

  • v-litu-msft Profile Picture
    on at

    Hi @JBille,

     

    Just like the method from @ScottShearer provided, the ticks() function can return the ticks property value from 0001-01-01T00:00:00Z to a specified timestamp. A tick is a 100-nanosecond interval, one second is 10,000,000 ticks. So you can Calculate the difference between utcNow and 1970, then div it to get the seconds.

    you can use the following expression:

    div(sub(ticks(utcNow()),ticks('1970-01-01T00:00:00Z')),10000000)

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • JBille Profile Picture
    43 on at

    Thank Lin Tu.

    That works exactly as I needed 🙂
    Br Jens

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard