Freeze
Freeze

Reputation: 37

How can I format time output in Power Automate

In my power automate flow, I have an action that give time output in this format: 2022-12-01T18:52:50.0000000Z How can I take this output and format as yyyy/mm/dd . I want to use the time output as string for a folder structure.

Upvotes: 0

Views: 991

Answers (2)

Skin
Skin

Reputation: 11217

https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#formatDateTime

Assuming you have a variable called DateTime, you would create another variable and use this expression ...

formatDateTime(Variables('DateTime'), 'yyyy/MM/dd')

Result

Result

Upvotes: 2

CobyC
CobyC

Reputation: 2447

This is pretty straight forward.

Use the Convert datetime to text function enter image description here

In the Format to use dropdown select Custom and specify the format how you would like it to appear. enter image description here

yyyy/MM/hh will give you 2022/12/01

HH-mm-ss will give you 18-52-50

enter image description here

Upvotes: 1

Related Questions