SOLVED

Formatting a date in Flow

%3CLINGO-SUB%20id%3D%22lingo-sub-182594%22%20slang%3D%22en-US%22%3EFormatting%20a%20date%20in%20Flow%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-182594%22%20slang%3D%22en-US%22%3E%3CP%3EI%20know%20this%20is%20crazy%2C%20but%20I%20using%20a%20flow%20that%20requires%20me%20to%20update%20a%20list%20with%20the%20value%20of%20a%20year.%20The%20problem%20is%20the%20users%20does%20not%20want%20'2018'%2C%20they%20only%20want%20'18'.%20Based%20on%20the%20information%20I%20have%20found%20there%20is%20no%20way%20to%20format%20a%20date%20'YY'%20...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAm%20I%20losing%20my%20mind%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-182594%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-185244%22%20slang%3D%22en-US%22%3ERe%3A%20Formatting%20a%20date%20in%20Flow%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-185244%22%20slang%3D%22en-US%22%3E%3CP%3EThat%20was%20perfect%2C%20thank%20you%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F16657%22%20target%3D%22_blank%22%3E%40Sandy%20Ussia%3C%2FA%3E!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-183458%22%20slang%3D%22en-US%22%3ERe%3A%20Formatting%20a%20date%20in%20Flow%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-183458%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%2F28866%22%20target%3D%22_blank%22%3E%40Mike%20Dumka%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20use%20a%20custom%20date%20format%20to%20achieve%20this.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUsing%20Flow's%20expression%20builder%2C%20select%20the%20%3CSTRONG%3EformatDateTime%3C%2FSTRONG%3E%20function%2C%20insert%20in%20the%20(%20)%20the%20dynamic%20content%20token%20that%20contains%20the%20date%20from%20which%20you%20wish%20to%20extract%20the%20year%2C%20type%20a%20comma%20after%20that%2C%20and%20type%20'yy'%20(in%20single%20quotes)%20to%20pull%20out%20the%20year.%20This%20is%20essentially%20formatting%20the%20date%20as%20year%20only.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20this%20help%20you%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESandy%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

I know this is crazy, but I using a flow that requires me to update a list with the value of a year. The problem is the users does not want '2018', they only want '18'. Based on the information I have found there is no way to format a date 'YY' ...

 

Am I losing my mind?

2 Replies
best response confirmed by Mike Dumka (Contributor)
Solution

Hi @Mike Dumka,

 

You can use a custom date format to achieve this. 

 

Using Flow's expression builder, select the formatDateTime function, insert in the ( ) the dynamic content token that contains the date from which you wish to extract the year, type a comma after that, and type 'yy' (in single quotes) to pull out the year. This is essentially formatting the date as year only.

 

Does this help you?

 

Sandy

 

That was perfect, thank you @Sandy Ussia!