community icon indicating copy to clipboard operation
community copied to clipboard

last.fm app displays time in UTC, not in local timezone

Open mashedkeyboard opened this issue 1 year ago • 7 comments

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?

mashedkeyboard avatar Sep 01 '24 19:09 mashedkeyboard

@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? :)

mashedkeyboard avatar Sep 03 '24 08:09 mashedkeyboard

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,.

my-ugly-code avatar Sep 03 '24 09:09 my-ugly-code

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

dtseiler avatar Oct 02 '24 21:10 dtseiler

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.

danielsitnik avatar Oct 03 '24 03:10 danielsitnik

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?

dtseiler avatar Oct 03 '24 13:10 dtseiler

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. 😢

danielsitnik avatar Oct 04 '24 13:10 danielsitnik

Thanks, I've added a note there about testing it as well.

dtseiler avatar Oct 04 '24 14:10 dtseiler

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!

stale[bot] avatar Nov 08 '24 23:11 stale[bot]