Sp-dev-docs: TimeZoneInfo wrong daylightDate and standardDate

Created on 24 Jan 2019  路  11Comments  路  Source: SharePoint/sp-dev-docs

Category

  • [x] Bug

Expected Behavior

TimeZoneInfo on context.pageContext.user should enable me to convert UTC to local time.

e.g. for timezone "(UTC+1) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna" (TimeZoneId 4)
daylightDate should be: March 31 2019 02:00 CET

Observed Behavior

TimeZoneInfo returns wrong dates for daylightDate (Day 5 of Month 3) and standardDate (Day 5 of Month 10) .
dates are returned as ISPSystemTime

I want to convert UTC to local time. Conversion with the formula from https://docs.microsoft.com/en-us/javascript/api/sp-page-context/sptimezone?view=sp-typescript-latest gives wrong results.

Needs spfx-general tracked

Most helpful comment

This issue still exists for probably all timezones.

Daylight Savings for Pacific Time:
image
_spPageContextInfo.userTimeZoneData:
image

All 11 comments

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

This issue seems to be not only present in the spfx WebPartContext class but also in sync with _spPageContextInfo.userTimeZoneData on classic sites and pages, where the same wrong DaylightDate and StandardDate objects are returned.

Any updates on this one? Its one week until summer time DST in Europe.

@mirkori Are you still seeing issues here?

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.

This issue still exists for probably all timezones.

Daylight Savings for Pacific Time:
image
_spPageContextInfo.userTimeZoneData:
image

Hey there... is there any progress on this issue? I'm also experiencing the same issue with the incorrect daylightDate (screenshot below):

image

The calculation of the date is correct, but the daylightDate doesn't have a public documentation, so the values will seem misleading. Here are the some of the non obvious property descriptions for daylightDate:
DayOfWeek = 0-6, Sunday - Saturday
Day = the Nth DayOfWeek in that month
@ahessami that example would be interpreted as the 2nd Sunday of March (March 10th)
There will be an update to the public API.

Thank you for the clarification @kemesfun . Should "day" be actually named "weekOfMonth" in this case, to align to the "dayOfWeek" naming?

@mirkori The variable name change is something we may consider, but whether or not this api will go beyond beta is still unknown.

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

Was this page helpful?
0 / 5 - 0 ratings

Related issues

waldekmastykarz picture waldekmastykarz  路  3Comments

karishmaTCS picture karishmaTCS  路  3Comments

acksoft picture acksoft  路  3Comments

byrongits picture byrongits  路  3Comments

jonthenerd picture jonthenerd  路  3Comments