cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User
Super User

Re: convertToUtc() not working (throws error)

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
Highlighted
Super User
Super User

Re: convertToUtc() not working (throws error)

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

Highlighted
Frequent Visitor

Re: convertToUtc() not working (throws error)

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

 

 

Highlighted
Dual Super User
Dual Super User

Re: convertToUtc() not working (throws error)

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
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (8,639)