Forum Discussion
UTC Date Time in New Folder Name
I'm very new to Flow and I'm failing to get the UTC date time in a new filename.
My flow works as follow, if an email arrives with an attachment, then save this attachment in a SharePoint online Folder. So far so good everything works. However now for the difficult part I want to create a new file name. Like MM/DD/YYY
_something.pdf
I've tried concat and formatdatetime functions but those doesn't seem to work, or I'm using them the wrong way.
- Damien_RosarioSilver Contributor
Try this:
1. Use the Connector option Convert time zone.and configure it as you need to (see example).
Ensure Base time is utcNow(), type the format you want to display the date in, choose source time zone as UTC and the destination being your local time zone.
2. Simply refer to the Converted time in your file name.
Hope that helps?
Cheers
Damien
- Manidurai MohanamariappanIron Contributor
You can use simply utcNow() in compose or if you want only date value of utc, you can use formatDateTime(utcNow(),'dd-MM-yyyy') in compose and then you can use that compose output value in file creating.
- Damien_RosarioSilver Contributor
I used to use that method until I found out that it doesn't account for your local time zone, it only displays the date per UTC so here in Australia (as an example), the date would still show yesterdays date even though I was generating the document today.
Here's a blog that explains the UTC versus local time zone difference.
https://flow.microsoft.com/en-us/blog/working-with-dates-and-times/
Cheers
Damien