community
community copied to clipboard
last.fm app displays time in UTC, not in local timezone
Hi folks!
The last.fm app in the repository, when it has its clock function toggled on, seems to be displaying UTC time rather than local time - but the documentation in the app settings for that toggle says it should display local time. For instance, it's just gone 8pm here in the UK right now (British Summer Time, UTC+1), but it displays just past 7pm.
I'm not clear on whether the Tidbyt API actually offers a way to retrieve the time in the current timezone? Other similar clock apps in the repo seem to have either timezone or location settings separately. Does one need to be added, or is there a simpler fix?
@my-ugly-code - hi! I think you're the original author of the last.fm Tidbyt app. I note from the contributing guidance that changes are subject to approval from the original app author - would you be happy with a timezone setting being added? :)
If other clock apps display correctly for you, yes, just implement what they're doing...seems to be .in_location(). I'm ok with whatever addition is needed to support TZs.
I'm guessing the function handles seasonal adjustments like Summer Time (DST in US). I'm in Eastern US and it's always 'just worked' for me,.
oooh I was just wondering if there was a way to get the "system" configured TZ, having a similar issue with the duolingo app being defaulted to London. I'll give this a shot there. Thanks @my-ugly-code
Yes, to get the timezone for the device's location configured in the mobile app you just do config.str("$tz").
It's always a good idea to have defaults if things change in the future, so something like config.str("$tz", "America/New_York") would work.
Yep I've done something similar. Is there a guide that mentions $tz? Are there other similar special variables that would be good to know about?
Sadly it's not mentioned in the documention. There's even a PR https://github.com/tidbyt/tidbyt.dev/pull/620 open since june to add it there. 😢
Thanks, I've added a note there about testing it as well.
We're automatically closing this issue because it hasn't had any activity in 30 days. If that seems like a mistake, please feel free to re-open. Thanks!