cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate IV
Advocate IV

Date convertion is returning a worng value.

Hi!! I'm trying to convert a date that I'm getting from SharePoint but the result is really odd.

 
The original date value in the SharePoint is 06/09/2018 (dd/mm/yyyy)
 
but the result of the formula is 
 
Captura de pantalla 2018-09-06 a la(s) 17.00.53.png
 
Here the formula I'm using!
 
convertTimeZone(items('Apply_to_each')?['Created'], 'Central Standard Time','Pacific SA Standard Time', 'ddmmyyyy')
 
Any idea?
 
Thank in advance!
2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Date convertion is returning a worng value.

Hi @diegoadum,

 

Please try the following code, I have made a test and it works fine:

ConvertTimeZone(triggerBody()?['Created'],'Central Standard Time','Pacific SA Standard Time','dd/MM/yyyy')

 1.PNG2.PNG

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Advocate IV
Advocate IV

Re: Date convertion is returning a worng value.

Looking at your example I noticed that my mistake was to use the mm instead MM in the month conversion. I made the change in the formula and now is working as should!

 

Good month value.PNG

 

so the formula now is like this:

 

convertTimeZone(items('Apply_to_each')?['Created'], 'Central Standard Time', 'Pacific SA Standard Time', 'dd/MM/yyyy')

 

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Date convertion is returning a worng value.

Hi @diegoadum,

 

Please try the following code, I have made a test and it works fine:

ConvertTimeZone(triggerBody()?['Created'],'Central Standard Time','Pacific SA Standard Time','dd/MM/yyyy')

 1.PNG2.PNG

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Advocate IV
Advocate IV

Re: Date convertion is returning a worng value.

Thank for the tip! Maybe you can explain what the difference between items and TriggerBody is? Smiley Very Happy

Highlighted
Advocate IV
Advocate IV

Re: Date convertion is returning a worng value.

In addition, I'm getting a null error now. Sorry, but I hit the accept as a solution too soon! AS you can see below I do have a value in the Created field, but Flow is not considering it as a valid value.

 

Flow null error.PNG

 

Highlighted
Advocate IV
Advocate IV

Re: Date convertion is returning a worng value.

Looking at your example I noticed that my mistake was to use the mm instead MM in the month conversion. I made the change in the formula and now is working as should!

 

Good month value.PNG

 

so the formula now is like this:

 

convertTimeZone(items('Apply_to_each')?['Created'], 'Central Standard Time', 'Pacific SA Standard Time', 'dd/MM/yyyy')

 

View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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,047)