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

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

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

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

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

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

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

 

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (8,073)