Hide the 'Hour Hand' during specific times by timezone

I know that using the Timeline allows you to hide the “Hour Hand” during specific hours. However, when I set the “Hour Hand” to a designated timezone (such as Eastern Time Zone).

The Timeline is “Sync with Device”. Although I can adjust the specified timezone and the current timezone in the Timeline, the problem arises if the designated timezone observes daylight saving time. In this case, the same method cannot be used to hide the “Hour Hand” in the Timeline, as it would result in abnormal displays during daylight saving time.

Could you please advise if there are other methods to hide the “Hour Hand” based on the specified timezone during specific hours?

@futureshock ,
You can change its opacity by using tag expressions.

(([HOUR_0_23]>12)?100:0)

You might not be allowed to use tag expression in hour hand of an analog clock. You can use an image in that case.

Thank you for your reply.

Assuming the local time is Bangkok (GMT+7), I want to hide an image after the PM in Tokyo (GMT+9). I tried writing it like this:

( ( ( [HOUR_0_23] - [TMZN_OFS] + 9) % 24 >= 12 ) ? 0 : 100)

but it didn’t work. Do you have any suggestions?

1 Like

I think the problem is the [TMZN_OFS] returning text string with plus or minus sign, which is then not calculated as number.
I would rather try to focus on UTC timestamp, which is independent from local time.
(((([UTC_TS]/1000/60/60)%24)+9)%24>=12?0:100)

2 Likes

I wonder if (0[TMZN_OFS]) would make a number. I haven’t tried it.

No, it returns text.

Bummer. I thought it miight have been too good to be true. Ta for trying it; I know I should have.

This shows promise: (1+(round([TMZN_OFS]))).
Obviously the 1+ isn’t wanted; I just used it to verify that the zone was being treated as a number.

This is probably too risky anyway. Not all time zones are integers; I doubt that the format for non-integer time zones is like +9.5; it’s probably +9:30.

Thank you, Peter

I hope to adjust daylight saving time automatically based on the timezone, without having to manually set “+9”.

For example, location like Chicago UTC-6, return “-6”, and during daylight saving time return UTC-5.

However, it seems that WFS does not handle the timezone string “America/Chicago” to return -6 or -5 according to daylight saving time.

Have you considered TMZN_OFS_WITH_DST? Beware that places with the same time zone won’t always have the same daylight saving arrangements, but maybe TMZN_OFS_WITH_DST addresses that.

Thank you for your suggestion. I will try using TMZN_OFS_WITH_DST to convert the timezone string to timezone offset. If I manage to do it, I will share it here.

I still worry that this will break for users in places with non-integer time zones, so it probably shouldn’t be published in the Play Store.

If WFS implemented more of WFF, we’d have access to a string slicing function that would allow dissection of the time zone string so that any minute component could be handled.

If I understand it right, goal was to display something according to fixed predefined timezone. I am not sure whether all timezones change summer time at same date (or at all), but I doubt it.
So

  1. the local DST property does not automatically correspond with the inspected timezone DST.
  2. TMZN_OFS_WITH_DST will also return text that can not be calculated with, same like did the one without DST.

With UTC timestamp you can calculate even for the zones with hour fractions.