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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (6,643)