cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

App not pulling the correct time

Hi,

I have a timetabling app in which I filter the data by a weekly date picker.

For every member of staff the app is pulling the correct date and time from the SharePoint List where I have used a Date&Time column.

 

But, there are a few staff members who are seeing the correct events and dates, however the time displayed has an hour difference.

 

Checks done:

  • User has checked machine timezone is correct.
  • SharePoint timezone in regional settings is fine.
  • I added a Time variable display with Now() which shows the correct time.

Apart from all the checks, the events being pulled have an hour time difference and this is only happening for 1 or 2 people.

 

Any suggestions would be greatly appreciated.

 

Thank you

4 REPLIES 4
Highlighted
Microsoft
Microsoft

Re: App not pulling the correct time

Hi @Mo_Islam ,

 

Are you updating your selected date and time to SharePoint list Date&Time field and in which some of the staff views a wrong result from what you selected?

 

I see what you have done for checking, but sometimes it is a little difficult to locate where the issue comes from especially with a large quantity of users and equipments, so I suggest you to:

 

1. Modify the date and time value with the format of UTC. This would help to always display the proper selected time in SP list.

Apply below formula on the Update of the date and time data card, assuming using 12 hours:

 

DateAdd(DateValue1.SelectedDate + Time(If(AMPMValue1.Selected.Value = "PM", 12, 0) + Mod(Value(HourValue1.Selected.Value), 12), Value(MinuteValue1.Selected.Value), 0), TimeZoneOffset() , Minutes)

 

2. Modify SharePoint list Date&Time column to a Single Line Text column type. This makes SP list field display the time in text format, and SP would not  convert the value while it will do with a DateTimeValue.

      i. Modify the field type to Text

37.jpg

    ii. Modify the Update property of date and time Data Card to:

 

Text(DateValue1.SelectedDate + Time(If(AMPMValue1.Selected.Value = "PM", 12, 0) + Mod(Value(HourValue1.Selected.Value), 12), Value(MinuteValue1.Selected.Value), 0))

 

 

You could also try to confirm that is there any add-ons for changing time zone installed in the web browsers of those two staffs.

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Highlighted
Helper III
Helper III

Re: App not pulling the correct time

Thank you @v-jefferni 

 

How can I use the 24 hour format instead?

 

I am using a manual form using patch and ForAll. The date and time line is as follows:

 

'Start Time': EditStartDatePicker_New_1.SelectedDate + Time(Value(ddEditStartHour_New_1.Selected.Value), Value(ddEditStartMinutes_New_1.Selected.Value),0),
            'End Time': EditStartDatePicker_New_1.SelectedDate + Time(Value(ddEditEndHour_New_1.Selected.Value), Value(ddEditEndMinutes_New_1.Selected.Value),0),

 

How can I apply your suggestion?

 

And if I change the Date/Time column to text, will this affect the existing data?

 

Thank you

Highlighted
Microsoft
Microsoft

Re: App not pulling the correct time

Hi @Mo_Islam ,

 

Please replace below formulas with yours:

 

'Start Time': DateAdd(EditStartDatePicker_New_1.SelectedDate + Time(Value(ddEditStartHour_New_1.Selected.Value), Value(ddEditStartMinutes_New_1.Selected.Value),0))
'End Time': DateAdd(EditStartDatePicker_New_1.SelectedDate + Time(Value(ddEditEndHour_New_1.Selected.Value), Value(ddEditEndMinutes_New_1.Selected.Value),0))

 

For your question, if changing the Date/Time column to text, existing data would be affected and cleared.

48.png

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution  to help the other members find it.
Highlighted
Helper III
Helper III

@Re: App not pulling the correct time

Dear @v-jefferni 

 

Thank you for replying.

What I did is re-create my database, but this time am storing the Date & Time in this format under the Column name EventStart  dd/mm/yyyy hh:mm

 

It seems to work fine for most people, but some machines convert the date in to the US format which means the schedule for a user is not filtered correctly.

 

Is there a way to make the powerapp use a particular DateTime Format?

 

I'll give you an example to make it clearer:

 

Mo_Islam_0-1602268793797.png

To show the above correctly, 

THIS WORKS ONLY FOR SOME:

Sort(Filter(colMA_MyTimetable, Text(DateTimeValue(EventStart),"[$-en-GB]dd-mmm") = val_Mon_W.Text),EventStart,Ascending)

 

I had to change it as this to ensure it works for everyone:

Sort(Filter(colMA_MyTimetable, StartsWith(EventStart,Text(DateAdd(WkStartDate_W.SelectedDate,1,Days),"[$-en-GB]dd/mm/yyyy"))),EventStart,Ascending)

 

On some machines, the Date format is mm/dd/yyyy  which is causing this issue.

Any ideas will be grateful.

 

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.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,900)