cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JR-BejeweledOne
Super User
Super User

Bizarre Date Issue

I have a Holiday calendar app.  The gallery that displays the company holidays for the selected location is displaying a filtered collection of holidays that is gathered on App start from the SharePoint list.    The date displayed is a Date/Time (Date Only) field.

 

I have reports from a few people that the dates being displayed are consistently 1 day earlier than they should be.    We have checked numerous things from their computer time settings and browser settings but they are all normal.

 

In troubleshooting the app, I have used the TimeZone offset to capture the local time.   Per MS by default it should show the current date/time without having to pass it a parameter, but it's not.   Here is what it's displaying, note the bottom label is set to display the current date/time offset.   The current time display remains the same regardless of when we look at it

 

Per Microsoft's documentation:  "TimeZoneOffset defaults to the current time, so you don't need to pass it an argument."

 

DateTimeIssueESTCorrect1.jpg

 

TimeZoneOffset for Current Date/Time

 

 

 

"Current Time: " & Text(TimeZoneOffset(), ShortDateTime)

 

 

 

 

TimeZoneOffset for UTC Date/Time

 

 

 

"UTC Time: " & DateAdd(Now(), TimeZoneOffset(), Minutes)

 

 

 

 

Here is what we are seeing:

 

SharePoint List:

DateIssueSiteRegionalSettings.jpg

 

DateIssueSharePointDates.jpg

 

Here is what it should look like in the Power App:

DateTimeIssueESTCorrect.jpg

 

Here is what the two users I am working with (1 in EST and 1 in CDT) are seeing:

 

DateIssueESTIncorrect.jpg

 

 

If you can help me figure this out, I will be eternally grateful.

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
8 REPLIES 8
Pstork1
Dual Super User
Dual Super User

One thing to be careful of is using timezoneoffset with no parameter.  You are correct that when you use it without parameter it will return the timezoneoffset for the current local time.  But if you are then using that with a time that is from a different point in the year you will be off by an hour.  timezoneoffset() needs a particular date as the parameter to decide what the current offset should be on that date for that location.  Due to Daylight savings time that will vary across a year. So timezoneoffset called without a parameter in July will be different than timezoneoffset called in January.  Unless you are working with the current date and time I would recommend always adding the date you are looking at as a parameter in timezoneoffset.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Right now it's there just for context to determine what is being seen by each of the people experiencing the issue.    So I need it to be the current time.   I can certainly pass Now() to it and see if that makes a difference but according to MS I shouldn't have to.

 

I added it as an additional piece of information to determine why some people are seeing the date in the list of holidays as a day earlier.   So if the date in the SharePoint list is 1/3/2022, these people are seeing 1/2/2022.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

You say one user is in EST and one in CDT. Shouldn't it be EST and CST?  For the Central timezone user if the Date/time is coming in as midnight 12/30 Eastern time then that is actually 11PM 12/29 in the Central timezone.  But I'm not sure what is happening for the EST user.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

CDT is Central Daylight Time as opposed to Central Standard Time.

 

I could understand this if everyone in the CDT/CST were seeing the dates as a day earlier.    However they aren't.   99.9% of the people are seeing the dates as they should be.   And that doesn't explain why my user whose time zone is EST, which is the same setting in the SharePoint regional settings, is seeing them as a day earlier. 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

As I said, I can't explain the one in EST.  But Timezone settings are managed at a lot of levels besides just SharePoint.  I have to assume that something is set incorrectly for that one user's account somewhere.  I don't know where.

 

My point about CDT is that right now the Central time zone is in CST.  CDT doesn't start until March. I live in Central time zone US.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

I only used CDT because that's what the user said his time zone is.   We checked his browser settings and his computer settings and they are all accurate.   So I don't have a clue here.   I think I have 3 people who are experiencing the issue.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

My last thought would be, Did you check his user profile settings in SharePoint?  User's can override the sites time zone with their own personal time zone setting in their profile.  I used to do it as a traveling trainer.  But in general I don't recommend it because it can cause confusion just like you are seeing.  I don't know that it is really surfaced anywhere anymore, but if you edit the user's profile in SharePoint Admin Center > More Features > User Profile Service you'll find a setting buried in their profile.  That can change how SharePoint acts for that particular user.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

I will have to look into that.  Thanks for the tip



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,372)