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

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

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

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (10,868)