Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support timezones without daylight savings time (Case 943047) #801

Merged
merged 1 commit into from
Jan 18, 2018

Conversation

mderoy
Copy link

@mderoy mderoy commented Jan 17, 2018

Release Notes: Fixes an issue where certain platforms failed to do time conversions to a user's local timezone

@mderoy mderoy self-assigned this Jan 17, 2018
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// Michael DeRoy
// Jonathan Chambers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want emails

string[] names;
if (!System.CurrentSystemTimeZone.GetTimeZoneData (1973, out data, out names))
string[] names;
int currentYear = DateTime.UtcNow.Year;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No chance of infinite recursion here, right?

Copy link
Author

@mderoy mderoy Jan 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, looks like DateTime.UtcNow calls into an icall to get the current system time..converts that to ticks and passes it into the DateTime() constructor...should be no chance of recursion, and I'm not seeing it myself.

DateTime dltStartTime = new DateTime(1, 1, 1).Add(dlt.Start.TimeOfDay);
DateTime dltEndTime = new DateTime(1, 1, 1).Add(dlt.End.TimeOfDay);
TimeSpan utcOffsetTS = TimeSpan.FromTicks(data[(int)TimeZoneData.UtcOffsetIdx]);
char utcOffsetSign = (utcOffsetTS >= TimeSpan.Zero) ? '+' : '-';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var please

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok ;(

@mderoy mderoy changed the title [WIP] Support timezones without daylight savings time Support timezones without daylight savings time Jan 18, 2018
@mderoy mderoy merged commit e01ef6d into unity-master Jan 18, 2018
@mderoy mderoy changed the title Support timezones without daylight savings time Support timezones without daylight savings time (Case 943047) Jan 23, 2018
@joncham joncham deleted the unity-master-tz-fix-build branch March 15, 2018 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants