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

View solution in original post

mj2
Frequent Visitor

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 III
Dual Super User III

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,367)