Hi,
I have a string that comes from an Output like this:
["05/22/2019 00:00:00"]
And I would like to know the day of the week and the month written in letters to be sent on an email like this:
"Tomorrow Wednesday, the 22nd of May, ..."
There is no way I could make it work 😞
Thank you for your help!
Guillermo
Solved! Go to Solution.
Note: If the string is coming in the type:
["05/22/2019 00:00:00"]
you need to do another compose action to extract just the date and time by using :
substring(variables('re'), 2, 19)
here 're' is my variable with the string (["05/22/2019 00:00:00"])
your next compose action will be:
formatDateTime(outputs('Compose_2'), 'dddd, dd''nd'' ''of'' MMMM')
Here compose_2 is the output of the substring.
Hope this helps!
Thanks,
Hi,
You can follow the steps as shown in the screenshot to compose the date and time accordingly.
Expression: formatDateTime(variables('re'), 'yyyy MMMM dddd')
This will give you the desired format : formatDateTime(variables('re'), 'dddd, dd''nd'' ''of'' MMMM')
The expression can be modified.
Thanks,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
An alternative to @yashag2255's answer is to use the convert time zone action (see image below):
Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
Hi,
I get the following error when implementing the solution:
What could it be wrong?
Thank you again
Hi @Anonymous
Please check that the date time string is of the form :
05/22/2019 00:00:00
Add a compose action with the expression:
formatDateTime(variables('re'), 'dddd, dd''nd'' ''of'' MMMM')
Please note that 're' is a variable that I have created.
Can you post a screenshot of your compose action so that we can assist you better?
Thanks,
Note: If the string is coming in the type:
["05/22/2019 00:00:00"]
you need to do another compose action to extract just the date and time by using :
substring(variables('re'), 2, 19)
here 're' is my variable with the string (["05/22/2019 00:00:00"])
your next compose action will be:
formatDateTime(outputs('Compose_2'), 'dddd, dd''nd'' ''of'' MMMM')
Here compose_2 is the output of the substring.
Hope this helps!
Thanks,
hi,
it worked!!
Compose 4 does a Union to get unique values
Then it is saved on a variable of type string
And then the replacing you suggested.
Finally formatDateTime(...) worked!!!
Awesome, I will validate your response.
But then surely if you use ''nd'' and the date is the 4th of the month you'll get the wrong result. 4nd isn't right!
formatDateTime(outputs('Compose_2'), 'dddd, dd''nd'' ''of'' MMMM')
Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
Perfect! Glad that it worked for you.
Thanks,
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
41 | |
40 | |
37 | |
34 | |
30 |
User | Count |
---|---|
49 | |
37 | |
35 | |
29 | |
24 |