Search Issue Tracker

Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.

Postponed

Votes

8

Found in

5.1.3f1

Issue ID

723483

Regression

No

[WIN] System.TimeZoneInfo does not return any Time Zones

Scripting

-

How to reproduce:

1. Open attached project
2. Open scene Main.unity
3. Play the scene
- Note that the number printed in the log is 0

Comments (14)

  1. Shadowing

    Nov 03, 2019 17:48

    This is what you guys need to do to get a devices local time offset.

    TimeZoneInfo localZone = TimeZoneInfo.Local;
    int currentOffset = (int)localZone.BaseUtcOffset.TotalSeconds;

    I live in Missouri so this returns -21000 for me.

    Or if you need display formats
    localZone.StandardName will return (UTC-08:00) Pacific Time (US & Canada)
    localZone.StandardName will return Pacific Standard Time.
    localZone.BaseUtcOffset will return -06:00:00

    https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.local?view=netframework-4.8

  2. epernigo

    Sep 27, 2019 07:40

    My workaround is to use NodaTime plugin that use a tzdb provider for conversion.
    Look at this for how to do conversion:
    https://stackoverflow.com/questions/19252700/converting-between-time-zones-with-noda-time

  3. RaddTeck

    Oct 25, 2018 14:09

    Kind of ridiculous that i can't show my users the time on windows... This should not be that hard to fix.

  4. czBrian

    Apr 30, 2018 06:22

    I'm running into this bug today too... It doesn't like the MS Time zone Identifier, nor the IANA time zone identifier. (Tested with "Pacific Standard Time" and "America/Los_Angeles" respectively)

  5. Fillmore

    Jan 30, 2018 18:46

    Knock knock from 2018

  6. Murtaya

    Jan 28, 2018 03:19

    Since this bug is postponed, is there a known workaround for it?

  7. kleinsan

    Jan 04, 2018 09:49

    Please fix this!

  8. soaring

    Oct 02, 2017 19:32

    +1

  9. 10thPlanet

    Sep 07, 2016 09:14

    I built everything in mac and everything worked regularly despite several tests. I sent the project and find that nothing works in Windows. The project clearly I was rejected and I have just made a fool of by incompetent. Some solution?

  10. tolstenko

    Aug 10, 2016 23:02

    Still crashing

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.