Working with dates & times in Microsoft Flow

Recently I found out that the Workflow Definition Language schema for Azure Logic Apps is also supported in Microsoft Flow. This makes it a lot easier to work with dates and times.
You can use the "Data Operations - Compose" action to work with those dates.

Dates

For a workflow it can be very useful to get the current date, day, month or even year. To do this, the following scenarios are possible:

Datetime

"@utcnow()"

The above code snippet will return this:

2017-05-01T14:15:49.2489230Z  

Day

"@utcnow('dd')"

The above snippet will return the current day of the month:

01  

You can also get the day in a diffent form with the following snippet:

"@utcnow('dddd')"

This will return the full name of the day of the week.

Monday  

Month

"@utcnow('MM')"

The above snippet will return the current month:

05  

You can also get the full name of the month:

"@utcnow('mmmm')"

The above snippet will return the full name of the current month:

May  

Year

"@utcnow('yyyy')"

The above snippet will return current year:

2017  

Times

Long time

"@utcnow('T')"

The above snippet will return the long time:

2:59:47 PM  

Short time

"@utcnow('t')"

The above snippet will return the short time:

2:59 PM  

Conclusion

Take it for a spin yourself! It's really great way to use date and times it in different cases. Serge Luca wrote a great blog about other possibilities of the Workflow Definition Language.

Comments

comments powered by Disqus