2019-08-19, 18:51
In the Kodi regional settings it will list the regional date and time formats. You can adjust these or keep whatever the default is for your area.
I'm wondering if there is a way to tie into these when writing an addon so that you follow the user specified values? I think it would be useful when displaying a date or time to be able to format it in the regional format based on the user's preference setting. I tried looking through the Pydocs, built in function, and JSON-RPC but couldn't find anything that looked like what I needed. I'm guessing it's not available but wanted to check just in case.
If it doesn't exist something within an addon where you could pass in a datetime or Unix timstamp and get a string formatted in the correct way based on these settings would be awesome. Might need a couple functions like getDate() or getTime() with perhaps some args for the short/long values of each.
I'm wondering if there is a way to tie into these when writing an addon so that you follow the user specified values? I think it would be useful when displaying a date or time to be able to format it in the regional format based on the user's preference setting. I tried looking through the Pydocs, built in function, and JSON-RPC but couldn't find anything that looked like what I needed. I'm guessing it's not available but wanted to check just in case.
If it doesn't exist something within an addon where you could pass in a datetime or Unix timstamp and get a string formatted in the correct way based on these settings would be awesome. Might need a couple functions like getDate() or getTime() with perhaps some args for the short/long values of each.