Converting Epoch Time into DateTime with Azure Logic Apps

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!

If you’re building integrations with Azure, you might also find my articles on Azure Static Web Apps and Azure Functions helpful for your serverless architecture.

Kevin Griffin - Microsoft MVP and .NET Expert

About Kevin

Kevin Griffin has been running production .NET applications and teaching developers for over two decades. A 16-time Microsoft MVP specializing in ASP.NET Core and Azure, Kevin brings real-world experience from his own SaaS products alongside his consulting work at Swift Kick. He's hosted the Hampton Roads .NET User Group since 2009 and founded RevolutionVA, the nonprofit behind Hampton Roads DevFest. Kevin's talks blend hard-won lessons from production systems with practical advice you can use Monday morning.