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

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

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

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

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 367 members 4,618 guests
Please welcome our newest community members: