cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Format Date and Time changes time

Hi, I have been playing with this for some time and I Don't know what is the source of the issue to solve it.

I have SharePoint list which  has a start date and time field

I have a flow which reads these fields when an item modified or created and via API populates the value on another database.

 

I need to format the date to be able to put it on the database

this is the formula I use to format time

 

formatDateTime(triggerBody()?['Date'],'hhmm')
 
the problem is the output of this formula is 1 hour more than what I put in the list
for example I put 3:00pm and the formatDateTimeShows 4:00pm
and during daylight sayving it adds 2 hours
for example I put 3:00pm and the formatDateTimeShows 5:00pm
 
this is the setting I have in my site
2019-03-21_12-59-52.png
 

 

Any Idea how to fix this

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Format Date and Time changes time

Hi @EhsanAliverdi ,

 

This is because of the difference between the time zone you set and the default time zone of MS Flow.

The recommended methods are the following two.

  • Use Convert time zone action to convert the time, as below:

4.PNG

  • In addition, since you already know the time difference, you could use addHours() function to eliminate the time difference. And the third parameter can directly set the format of the time, like:
addHours(triggerBody()['Date'],-1,'hhmm')

 

Hope it helps.

 

Best Regards,

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

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Format Date and Time changes time

Hi @EhsanAliverdi ,

 

This is because of the difference between the time zone you set and the default time zone of MS Flow.

The recommended methods are the following two.

  • Use Convert time zone action to convert the time, as below:

4.PNG

  • In addition, since you already know the time difference, you could use addHours() function to eliminate the time difference. And the third parameter can directly set the format of the time, like:
addHours(triggerBody()['Date'],-1,'hhmm')

 

Hope it helps.

 

Best Regards,

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

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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 Kudoed Authors
Users online (10,506)