Skip to main content

How do I format a datetime in a 0365 workflow.

I tried the:

fn-FormatDate({Current Item:MyDate}‍, "yyMMdd")

But that just outputs:  fn-FormatDate(6/1/2019 3:45:00 PM, "yyMMdd") 

I know there are the insert options to select ISOFormatted, Long/Short Date/Time but none of those work for the format I need.   ISO is the closest, but since it returns the value in GMT the date/time can appear to be off to users (since they don't expect GMT)

 

As an added wrinkle I need it in 24hr time.

 

Any suggestions?   

So the best solution I could come up with is to use regex and extract the digets from the datetime as string (/d+)   then I created a parallel process to pad with 0's  and change the hours to 24hr time (based on AM/PM) and then finally did a string builder to combine all the values in the order I wanted.



And extra 20+ actions but it works.


Has anyone found another way? i tried the regex to pull the year of a variable date but when i combine it with my other variables it shows up with a bracket and quotes. ex ["2019"] instead of just the number. 



 



i used this - (dd)w+



date: 9/17/2019 12:25:23 PM


Reply