UTC Date Time in New Folder Name

%3CLINGO-SUB%20id%3D%22lingo-sub-751285%22%20slang%3D%22en-US%22%3EUTC%20Date%20Time%20in%20New%20Folder%20Name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-751285%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EI'm%20very%20new%20to%20Flow%20and%20I'm%20failing%20to%20get%20the%20UTC%20date%20time%20in%20a%20new%20filename.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EMy%20flow%20works%20as%20follow%2C%20if%20an%20email%20arrives%20with%20an%20attachment%2C%20then%20save%20this%20attachment%20in%20a%20SharePoint%20online%20Folder.%20So%20far%20so%20good%20everything%20works.%20However%20now%20for%20the%20difficult%20part%20I%20want%20to%20create%20a%20new%20file%20name.%20Like%20MM%2FDD%2FYYY%3CBR%20%2F%3E_something.pdf%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EI've%20tried%20concat%20and%20formatdatetime%20functions%20but%20those%20doesn't%20seem%20to%20work%2C%20or%20I'm%20using%20them%20the%20wrong%20way.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-751285%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-751455%22%20slang%3D%22en-US%22%3ERe%3A%20UTC%20Date%20Time%20in%20New%20Folder%20Name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-751455%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F368396%22%20target%3D%22_blank%22%3E%40BryceKauffman%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETry%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20Use%20the%20%3CSTRONG%3EConnector%3C%2FSTRONG%3Eoption%20%3CSTRONG%3EConvert%20time%20zone%3C%2FSTRONG%3E.and%20configure%20it%20as%20you%20need%20to%20(see%20example).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F123102i5530A2C554F2BDE5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22capture20190712124644529.png%22%20title%3D%22capture20190712124644529.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEnsure%20Base%20time%20is%20%3CSTRONG%3EutcNow()%3C%2FSTRONG%3E%2C%20type%20the%20format%20you%20want%20to%20display%20the%20date%20in%2C%20choose%20source%20time%20zone%20as%20%3CSTRONG%3EUTC%3C%2FSTRONG%3Eand%20the%20destination%20being%20your%20local%20time%20zone.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20610px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F123101i637F41701D1EC89D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22capture20190712124214867.png%22%20title%3D%22capture20190712124214867.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.%20Simply%20refer%20to%20the%20%3CSTRONG%3EConverted%20time%3C%2FSTRONG%3Ein%20your%20file%20name.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20614px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F123103i48FC35749B72C708%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22capture20190712124746581.png%22%20title%3D%22capture20190712124746581.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20that%20helps%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%3C%2FP%3E%3CP%3EDamien%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-753283%22%20slang%3D%22en-US%22%3ERe%3A%20UTC%20Date%20Time%20in%20New%20Folder%20Name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-753283%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F368396%22%20target%3D%22_blank%22%3E%40BryceKauffman%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20use%20simply%20%3CSTRONG%3E%3CSPAN%3EutcNow()%3C%2FSPAN%3E%3C%2FSTRONG%3Ein%20compose%20or%20if%20you%20want%20only%20date%20value%20of%20utc%2C%20you%20can%20use%26nbsp%3B%20%3CSTRONG%3Ef%3CSPAN%3EormatDateTime(utcNow()%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E'dd-MM-yyyy'%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%3E%3CSTRONG%3E)%3C%2FSTRONG%3Ein%20compose%20and%20then%20you%20can%20use%20that%20compose%20output%20value%20in%20file%20creating.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20877px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F123214i3150E834AA8DDD81%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22flow%20step%201.jpg%22%20title%3D%22flow%20step%201.jpg%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20546px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F123215iF05B702251418D44%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22flow%20step%202.jpg%22%20title%3D%22flow%20step%202.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-754120%22%20slang%3D%22en-US%22%3ERe%3A%20UTC%20Date%20Time%20in%20New%20Folder%20Name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-754120%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F3058%22%20target%3D%22_blank%22%3E%40Manidurai%20Mohanamariappan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20used%20to%20use%20that%20method%20until%20I%20found%20out%20that%20it%20doesn't%20account%20for%20your%20local%20time%20zone%2C%20it%20only%20displays%20the%20date%20per%20UTC%20so%20here%20in%20Australia%20(as%20an%20example)%2C%20the%20date%20would%20still%20show%20yesterdays%20date%20even%20though%20I%20was%20generating%20the%20document%20today.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20a%20blog%20that%20explains%20the%20UTC%20versus%20local%20time%20zone%20difference.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fflow.microsoft.com%2Fen-us%2Fblog%2Fworking-with-dates-and-times%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fflow.microsoft.com%2Fen-us%2Fblog%2Fworking-with-dates-and-times%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%3C%2FP%3E%3CP%3EDamien%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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.

3 Replies

Hi @BryceKauffman 

 

Try this:

 

1. Use the Connector option Convert time zone.and configure it as you need to (see example).

 

capture20190712124644529.png

 

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.

 

capture20190712124214867.png

 

2. Simply refer to the Converted time in your file name.

 

capture20190712124746581.png

 

Hope that helps?

 

Cheers

Damien

@BryceKauffman 

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.

flow step 1.jpgflow step 2.jpg

@Manidurai Mohanamariappan 

 

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