Get Timezone properties?
#1
I can see that the timezone can be set under Appearance > Settings > International, but how can I access this setting in my script?

There doesn't seem to be any documentation.

Efforts such as xbmc.getInfoLabel('System.Timezone') don't work. (String 'System.Timezone' is echoed back)

I need something that can be dropped into pytz and works in Frodo, so I need 'Europe/London' etc.

Ta.
Reply
#2
Any help with this?
Reply
#3
I used the python-dateutil library to do this. You need to download the library and copy it to your add-on folder.

Here's an example on how to convert datetime strings with the dateutil library (not specific to XBMC):
http://stackoverflow.com/questions/47702...l-datetime
Reply
#4
(2014-04-07, 18:41)Carb0 Wrote: I used the python-dateutil library to do this. You need to download the library and copy it to your add-on folder.

Here's an example on how to convert datetime strings with the dateutil library (not specific to XBMC):
http://stackoverflow.com/questions/47702...l-datetime

Pointless because you still don't get what xbmc has set in the settings
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#5
Does that respect XBMC settings?

[Edit: Martijn got there before me]
Reply
#6
Any news on this?
Reply
#7
Code:
timezone = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Settings.GetSettingValue", "params": {"setting": "locale.timezone"}, "id": 1}')
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#8
Just returning {"id":1,"jsonrpc":"2.0","result":{"value":"default"}} for me on win 8.1. The setting is missing from the menu so I thought it would be set internally.
Reply
#9
returns {"id":1,"jsonrpc":"2.0","result":{"value":"Europe/Amsterdam"}} for me.

the settings is located here:
settings > appearance > international > timezone.
and make sure the 'settings level' is at least 'standard'.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#10
(2015-02-01, 17:02)ronie Wrote: returns {"id":1,"jsonrpc":"2.0","result":{"value":"Europe/Amsterdam"}} for me.

the settings is located here:
settings > appearance > international > timezone.
and make sure the 'settings level' is at least 'standard'.

Tried again my, level was standard even with expert it's not showing up. I'm suspecting it's hidden, becaus its auto set? And maybe not passed correctly to this field?
And yes it does work for some users, but for some it just shows "default" like in my case.

Quote:Allows to select Timezone you country is located in.
Note: For some OSes XBMC will take this information from the OS instead of having a setting.
http://kodi.wiki/view/Settings/Appearance
Reply
#11
ah, didn't know that. apparently it's indeed os dependend.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#12
https://github.com/xbmc/xbmc/blob/8d8946...s.cpp#L514

But whats with that default? Thats not usable in any way? You probably have the right one set somewhere, just need a valid one for my plugin (default doesn't work Wink )
Reply
#13
For reference I'm now ignoring the kodi setting and get the local timezone from dateutil. Should do the trick.
Reply

Logout Mark Read Team Forum Stats Members Help
Get Timezone properties?1