Converting Epoch Time into DateTime with Azure Logic Apps

February 24, 2021

Recently, I've been building a handful of Azure Logic Apps that work with Stripe webhooks.

Stripe will commonly use Epoch time for it's dates.

But Epoch time is pretty useless for anything that is human-facing, and it's not necessarily the default for a lot of Microsoft solutions.

I needed a way in Azure Logic Apps to easily convert an Epoch Date into a readable format.

What is Epoch Time?

Epoch Time is the number of seconds that have surpassed since Midnight, January 1st, 1970. This is also commonly known as

Unix Epoch
.

Converting

Converting the time is pretty straight-forward, Epoch time is just the number of seconds since 1970-01-01 and Azure Logic Apps has a handy

addToTime
method we can use.

addToTime('1970-01-01T00:00:00Z', [EPOCH TIME HERE], 'second')

And ta-da! Your Epoch Time is now in a much easier to use format!