cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
diegoadum
Level: Powered On

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

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
diegoadum
Level: Powered On

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

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

diegoadum
Level: Powered On

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

diegoadum
Level: Powered On

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
diegoadum
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,813)