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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

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!

Users online (53,543)