Categories: Flow & PowerApps

Microsoft Flow Dates Times Timezones and Formatting

This will be a quick post, but thought someone out there might find it useful if they are working in Microsoft Flow and need to get a local date and time and/or format a date and time.

This evening I was building a Flow. In this case it is a Flow that sends an email and I wanted to include the current date in the subject of the email (i.e., “Here are your work items for 01/21/2018”.) The expression design in Flow still seems odd to me – being that I primarily write C# code and a good bit of JavaScript.

So after a few minutes of digging I figured out the expression:

formatDateTime(convertFromUtc(utcNow(),'Eastern Standard Time'), 'd')

Be sure to replace ‘Eastern Standard Time’ with the correct time zone name. You can get a list from this Microsoft support site. Be sure to use the value in the Name of Time Zone column. Also, if you are using a time zone with periods “.” in it you may or may not need to remove them, you’ll have to experiment. You can also get a list of time zone names on your computer (so they should work on Flow, but not guaranteed) with this line of code in LINQPad:

TimeZoneInfo.GetSystemTimeZones().Dump();

You can find the options for the time zone format here in the .NET documentation.

And keep having fun with Microsoft Flow…it’s a great platform that is constantly growing with new Connectors and Actions!
Nicolas Nowinski

Share
Published by
Nicolas Nowinski

Recent Posts

With AI, Written Language Matters Most

I'm not 100% certain I love this article. I made myself write it in less…

1 month ago

Can AI predict weather? AI’s DC Snow Forecast

I had a little fun a few days ago having AI do some forecasting for…

2 months ago

What the snow? AI Chatbots Predicting DC Weather!

Can AI Chatbots predict DC snow weather? I decided to try it out by letting…

2 months ago

History Does Not Predict the Future

History is far less useful than many assume. It creates the illusion of predictability only…

2 months ago

10 Choices for a Better Future No Matter What Happens

I'm not a fan of traditional New Years Resolutions, as I wrote about here, but…

2 months ago

The Human Blind Spot Around Non-Deterministic Machines

Why LLM's will always make mistakes and we shouldn't call them hallucinations I saw a…

6 months ago