Forum Discussion

Maria_DK's avatar
Maria_DK
Tin Contributor
Jan 14, 2020

Re: Create event in Flow uses wrong time format but only when date is larger than 12

Hi Damien_Rosario, 

Thank you for your reply.
The date is captured from a choice text field in a Form, where I have written the date as '09-03-2020 10:00'. So there is no date format in the input itself, it is only a string. 

In the screenshot you can see how I create the event.

Start time expression is this:
formatDateTime(body('Hent_detaljer_om_svar')?['rb52e2fa728e143a495c028f3b15dcf57'],'dd-MM-yyyy hh:mm')

 

The expression in the text is an exact copy of the one in the start time expression.

As I have set the time zone in the event itself, I do not see the need for converting time zone here.

 

If I do not specify any format, the event is created at the wrong date.

 

Are you saying that if my input is in the correct format and I use formatDateTime to make sure it keeps that format, it then changes the format? That makes no sense to me. And I cannot see how else I should turn the input into a date so I can use it for creating an event.

 

Here you can see the input and output from running the flow: 

Form output: 

 

Create event input:

Create event output: 

No RepliesBe the first to reply