1. Hey !

    I've got an exception when i call my function ...

    Code:
    [Oxide] 6:43 PM [Error] Failed to call hook 'cmdVoteTime' on plugin 'VoteKick' (TimeZoneNotFoundException: Exception of type 'System.TimeZoneNotFoundException' was thrown.)
    I'm using the DateTime functions : "DateTime.Now" and "new DateTime(0)"

    Can you please explain me how to set a TimeZone if it's the problem or tell me what the problem is ?

    Thanks !
     
  2. Wulf

    Wulf Community Admin

    It sounds like the system you are on doesn't have a timezone for some reason. I'm not sure you could really set it though. Do you have any issue using it from Lua or another language?
     
  3. Well i tried in python but i can't import the datetime module
    Code:
    ImportError: Import of module datetime not allowed
    And i don't know how to try it in Lua .. :/
    [DOUBLEPOST=1436987376][/DOUBLEPOST]Is this related to my server host ? Like is this something i should send a ticket for ?
     
  4. UP ! I still need help please.
     
  5. Wulf

    Wulf Community Admin

    I believe it's an issue with your server not having a timezone set via its registry somehow. What OS are you using?
     
  6. The server is hoted by GameServers, i don't know which OS they're using.
     
  7. Did this ever get resolved? I'm having the same issue.
     
  8. Had a workaround for this, one of these should work.

    Code:
    DateTime date2 = DateTime.UtcNow;
    DateTime date3 = DateTime.Today;
     
  9. Yep thank you. I found this yesteday - seems since GameServers uses linux hosting, it's missing the environment variable which the timezone-dependent DateTime.Now call depends on, so calling the DateTime.UtcNow property works around this.