Hi there,
I have seen other similar threads about the date conversion and seems like there is something weird going on around.
On my PVA my adaptive card has a formula to convert string to date which is :
Where the Compose 2 set up is:
Hi all,
A trick solution for the matter has been found. For now.
Instead of changing the formatDate on the second Compose component (ComposeOutput), place the following formula: addDays(outputs('Compose'),1,'dd/MM/yyyy').
This formula will add 1 day from the output of the first Compose component, so when the date is sent through the email, it will be exact date the user chose from the date picker and not one day before as it stands without the formula.
Any more info, please let me know.
Kind regards,
Fernando
Hi @Ricardo_Kerr ,
Can you post an example of the function, so the community can benefit of the solution you found?
Cheers,
Fernando
Defina na função o utcNow() para seu fuso-horário. Eu estou no Brasil e meu utc -3h.
Thanks. This helps confirm the issue isn’t on the Power Automate side and I would agree it looks like a bug since the date picker value from PVA isn’t what is getting sent. I’d suggest filing a ticket with Microsoft; you could temporarily add a day in Power Automate to the value but once the bug is resolved you’d have to undo that “fix.”
Hi @MattJimison,
See below the value from the PA flow:
See below the date picked from the date picker:
I tried the hour trick and didn't make a difference.
Big bug here.... 😕
@fernandosilva can you show the value in power automate, not in the PVA form? I want to see what value power automate is getting.
Also, did the hour trick work? That won’t add time to your date because it still outputs only a dd/MM/yyyy format - it’s just to ensure daylight savings doesn’t cause it to fall back when the date is parsed.
Hi @MattJimison ,
I won't need time with my date i'm afraid.
My input date can be seen here:
It's a date picker from adaptive cards and on PVA classic mode works perfectly fine, but not on the new canvas, which is kinda mess up and cool at the same time.
Anyway, the data from the form is sent by email and the date always come a day earlier with the new canvas.
I believe no one until now has come with a solution and I tried a million ways to do it, but seems like another bug in the system.
Cheers,
Fernando
try:
addHours(variables('YourDate'),1,'dd/MM/yyyy')
I'm wondering if your date doesn't have any time on it, which would make it midnight, and Daylight savings time is throwing it off by moving the time an hour back. This would move it an hour up to avoid that.
Also, if this doesn't work, can you please show the incoming value from PVA into your Flow? When I create a quick adaptive card with just a date picker, and use that variable, my value looks like this coming into Flow (in my case I'm only getting the date, no time, but when I try and recreate the issue with this kind of value, I'm unable to get the day before, and in the below example, the date I picked in the calendar control was August 14, 2023)
Find this post helpful? Please mark it as the solution and/or provide kudos so that it will help others in the future.
Cheers,
Matt
Hi @MattJimison ,
Thank you for your reply.
It doesn't matter if I drop the second argument or not, the date is still showing as one day before the day I chose from the dropdown calendar in the form.
There was no error on the classic PVA version about it and all was working as intended, so now with the new version comes all the new issues and bugs to be sorted.
Anyone from Microsoft to have a look at this issue please?
@HenryJammes
Hi, @fernandosilva
I would drop the second argument in your formatDateTime since you're already getting it in the format you want, and because differences between time zones could be causing the issue with dates not matching.
Change from:
formatDateTime(outputs('Compose'),'dd/MM/yyyy', 'en-GB')
To:
formatDateTime(outputs('Compose'),'dd/MM/yyyy')
Find this post helpful? Please mark it as the solution and/or provide kudos so that it will help others in the future.
Cheers,
Matt