cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mj2
Frequent Visitor

convertToUtc() not working (throws error)

Simple flow of only one element Compose where I have this:

 

Untitled1.png

 

and response is:

Capture1.PNG

 

No matter what I enter in convertToUtc it throws this error. 

I tried entering date/time manually as well, but error is the same. f.i.

convertToUtc('2019-10-10T00:00:00Z','FLE StandardTime')

 

convertTimeZone(utcNow(),'FLE Standard Time','UTC') does not throw error, but does not convert anything either.

convertFromUtc works as expected.

 

Can someone suggest how to convert from local time to UTC ? I want to pass UTC time to SharePoint.

1 ACCEPTED SOLUTION

Accepted Solutions
RobElliott
Super User
Super User

Hi @mj2, why don't you try the Convert time zone action as in the 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.

convertTimeZone2.jpg

View solution in original post

3 REPLIES 3
RobElliott
Super User
Super User

Hi @mj2, why don't you try the Convert time zone action as in the 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.

convertTimeZone2.jpg

Thanks for suggestion @RO . I did not know this component existed.

Anyway, this did not convert anything. 

 

Maybe I'm doing something wrong ?

Take a look to input ant output

Capture2.PNG

 

Here is how I configured it:

Capture1.PNG

 

UPDATE:

I changed input to '2019-10-19T00:00:00' and it worked. Basically removed 'Z' from input. 

 

Thanks

 

 

Pstork1
Dual Super User
Dual Super User

Make sure you remove the Z from the end of your timestamp that Z indicates that the timespan is already in UTC timezone.  That's why it won't convert to UTC.  Its already in UTC but you are trying to convert it from a specific timezone.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,792)