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

book a room incorrect time

Goodafternoon everyone,

 

I don't know if this is the right board to post my question/issue, please feel free to comment on that.

Please bare in mind I'm a novice in coding, so forgive my lack of knowledge 😉

 

I'm trying to get the the book a room App but there seems to be some time conversion bugging the outcome.

The app shows available rooms while they're occupied. It seems the app is 1 hr behind on our local time.

From what I understand, the App transforms local time to UTC, while I live in GMT+1. Is my statement correct and does the App convert local time to UTC? And if so, how can I change the code so the App uses GMT+1?

 

If I'm correct, the conversion is set by the button "ButtonNoMeeting" where the variable "StartDateTimeUTC" and "EndDateTimeUTC" are set. how can I modify bothe varaibles so the GMT+1 is used?


Set(StartDateTimeUTC; Text(DateAdd(StartDateTime; TimeZoneOffset(); Minutes); "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z");;
Set(EndDateTimeUTC; Text(DateAdd(EndDateTime; TimeZoneOffset(); Minutes); "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z");;

 

 

 

7 REPLIES 7
v-micsh-msft
Community Support
Community Support

Try:

Set(StartDateTimeUTC; Text(DateAdd(StartDateTime; TimeZoneOffset()+60; Minutes); "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z");;
Set(EndDateTimeUTC; Text(DateAdd(EndDateTime; TimeZoneOffset()+60; Minutes); "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z");;

See if doing this would make any difference.

Function reference:

DateAdd, DateDiff, and TimeZoneOffset functions in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Michael,

 

Thank you for your reply. I suspect something's wrong with our time settings in the O365/exchange online tenant.

 

Without the TimeZoneOffset()+60 param, when the book a room app checks for available rooms, it's 1 hour off, however... if I book the room, the booking time is correct in the room and in my own calendar.

 

with the TimeZoneOffset()+60 param, when the book a room app checks for available rooms, the application returns the free rooms at the selected time, however... if I book the room, the booking time is 1 hor off in the room and in my own calendar.

 

So there's a discrepancy in the get and post metohod's timing. I'm stuck at the moment...

It's kinda late but maybe this will help someone.

 

I've ran into the exact same bug. The problem was that i tested the application while on Ubuntu Linux. I was stuck for hours, until i got the ideea to test it on Windows and it worked fine.

 

The bug seems to only be on Linux. Android, iOS and Windows work for me.

Anonymous
Not applicable

Has anyone found a solution for this? adding +60 corrects the time in the automatic confirmation email for the meeting rooms but then places the calendar invite an hour ahead of the scheduled time?

 

i.e. I book a room for at 11am, without +60, the meeting room appears at 10am

 

with the +60 

 

i.e. i book a room for 11am and it appears at 12pm?

 

Is it a setting that needs to be changed in the app or somewhere else?

JKUK
Frequent Visitor

I have a very similar issue:

 

I'm in the UK so time is currently UTC + 00:00, the booking app clearly works in UTC, I send the appointment as per original code.  The booking request shows in the user calendar with outlook properties (calendar) set as our time zone so show correctly in calendar view.  But when you open up the appointment, it shows 1 hour different (-1) with UTC as time zone.  If I manually switch outlook time zone in the appointment (which on drop down shows as +00:00) I still get -1 hour showing on the appointment.  Is that because the original appointment is in UTC and a bug won't let me show it in the outlook appointment at the correct time, or; do i alter the app at the point of sending the appointment to alter the time zone, secondly alter the app all the way through as the first idea won't work if it's not right all the way through?!


chtz01
Regular Visitor

Has anyone got a solution for this? I am struggling with the same issue.

Dunc
Frequent Visitor

The coder sets StartDateTimeUTC and EndDateTimeUTC (their own variables to set a UTC timezone). These both use the built-in TimeZoneOffset function in a DateAdd function. If you place your cursor on TimeZoneOffset, you'll see the number of minutes they're deducting from the current time, to create his StartDateTimeUTC.

 

Dunc_0-1642796211637.png

 

 

The easiest way to fix this for your own timezone, without messing up all their code and having to find all instances of StartDateTimeUTC/EndDateTimeUTC, is to remove the DateAdd part of the function that creates the time offset.

 

Dunc_1-1642796211639.png

 

 

Replace the 2 lines of code where they Set Start & EndDateTimeUTC with:

 

Set(StartDateTimeUTC, Text(StartDateTime, "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z");

Set(EndDateTimeUTC, Text(EndDateTime, "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z");

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,473)