FACER Community

Digital Time Zone problem that anyone can help?

Hi,

I am in the process of making a dual time zone watch: analog shows current time and Digital shows time in Chile (UTC-4 & UTC-3).

Currently I am using this code ((#DUHZ#+20)%24) for UTC-4. The reason that it is +20 instead of -4 is because facer caused error showing the time as -1, -2, -3, -4,19,18… instead of 23,22,21,20,19,28… when using ((#DUHZ#-4)%24). I have also tried DUK, DUH, DUB tag with same problem.

I have checked some other posts and saw similar problems as well. Do let me know if there are better/updated code that avoids this bug.

Onto the main problem: Right now I’m using #DUHZ# but Chile changes it’s timezone twice in a year (UTC-4 & UTC-3):

UTC-4 (March to September)
UTC-3 (September to March)

Is there a way to make the code adapt to the changes of the UTC-4 to -3 automatically?

Much appreciated if anyone can help solving this.

1 Like

I’ve no idea sorry, my math is practically non-existent, but I’m sure some of our more knowledgeable members can help you when they come online.

2 Likes

So @nikgadafi . Not an easy one . Some others may join in . But al I can do is show you something I did recently for Tokyo time . I can not help you with Daylight Saving . I would be happy to know the time UTC on another part of the planet within an Hour . If you need to know exactly look at the Phone . I have people I speak to in Japan and it is useful to know roughly what time it is . Please Inspect the work and take what you wish .
Get back if you are nor sure .

1 Like

Thanks for sharing Russell,

Yeah I hope someone could help with the daylight saving. I have seen other timezone watchface that is not by facer and not having this issue, too bad I can’t inspect them.

Regarding what you have shared: I’ve inspected you’re using $#DUH#>14?(((#DUH#)+9)-24):((#DUH#)+9)$ for the Japan timezone (UTC+9). It’s quite different to the code that i’m using, and i just cant understand the >14? part. How can this code be used for timezone UTC-3?

I find it hard to know which timezone code/tag is correct as the time preview(time machine) on the watchface creator sometimes shows incorrectly yet on other times it fixes itself.

1 Like

You will have to play arround a bit. Yeah it is difficult to test. But if it does the Change over correctly you are probably OK.
So 14 comes about with 24 - 9 . Minus Nine is the time difference for Tokyo for me. So it should be 15 but I think 14 accounts for the Daylight saving.
You could do searches on the community to see if there are any other Topics.

This is Intresting. See they are looking at 12 hrs clock. So 7 + 6. See we are one hour over. But because we are using > we need that for the Cross over. I tried >= and it did not work.
I found ti’s from a quick search. There is a lot of good stuff out there. There is a lot for Pros with Vars. If you have that it could be easier. I have not.
I am sorry the code I came up with is not the same as yours. My Maths is a creative process. Each coder has thier own way of doing things. I can assure you mine can be improved.

1 Like

Thanks for the explanation Russell, I’ll try to dig further on this. Never expected the coding part be complicated for the timezone and my math is not any better :slight_smile:

1 Like

Strangely it is easier to do it with a rotational as the Rotational handles the crossing of 0 automatically . What you have decided to tackle is one of the more difficult things to do .

1 Like

Just wondering. By any chance Is there a way to make digital hour layer visible at certain months and invisible at another?

eg: UTC-4 digital hour layer is visible from March to September, then it fades out, then UTC-3 hour layer fade in (September to March) overlapping it.

1 Like

Yeah Defiantly . Good project . I have noting in my parts box . We might need to invoke someone with more experience . I am doing something else at the moment . There is a Day counter for the year so you will need the numbers of the days you want things to change . I am not sure but we might have to consider the Leap years but may be not . I think fade over a numbers of days is not going to look good . I will Have a look in a bit

1 Like

So here is a WIP TEST to get the ball rolling . On the Facer Community we are invited to assist people to make their faces . But sometimes it is Impossible not to Dive in an just take over.
So we need to look at leap years as you change over is just after the end of February . But strangely that males it easier . This will give you something to play with and claim the space on your Face .

I presume you know how to wrangle the Date on the Time Machine.

2 Likes

So to get this to work correctly with the Leap years we have to integrate this work .

Then we have to take into account the Sunday they change the clocks in Chile .

I hope you are able to Imagine that is a lot of work .

I would seriously cut your losses and have it correct for half the year and out by one hour the rest. Seriously if you need it more accurate than that you need another device.

2 Likes

Thanks Russel, apologies, I was on away on holiday sorry for the late reply.

Yup i know about the time machine, its a must to test the code :slight_smile:

Thanks for letting me know the degree of complication involved. I was hoping for a code that automates that but it seems too difficult like you mentioned. I hope Facer can have a dedicated code that follows a country time itself in the future rather than just UTC.

Much appreciated for your time.

1 Like

Inspecting the Opacity Settings: Your code $#DD#>=60&&#DD#<=244?100:0$

As i understand it day counter within 60 to 244 as 100% opacity and after that it becomes 0% opacity by using the code at the end 100:0

this is great already. godly, i wouldn’t have figured it myself.

As for the UTC math for Chile the: $#DUH#<3?(((#DUH#)-3)+24):((#DUH#)-3)$ as i understand it the part of “<3?” number follows the “-3” UTC (<4 for -4 UTC). but on your Japan example its >14? for +9 UTC. It doesn’t follow a logic that I can understand when compared but thanks for making it work for me.

1 Like

My Dear Friend. I am not a Mathamatician and I do my Maths creatively . You must play about with these things to see if you can get feel for things yourself.
One of the big problems is crossing the Zero with formulas. In Chile they are ahead of GMT /UTC. In Japan they are behind. If I could explain better I would. If you just chose somewhere on the planet randomly and see if you can get it right by changing the numbers. Normaly in a formula like that you would expect to see >= but when I tried that it all went wrong.

Get back if you need more than that and we will try find you a real Master. The are some about but I call on them so much I wonder if the dont like me any more. :rofl::thinking::joy:

1 Like

Haha, no worries Russell, I’m no different or even worse at math lol. I’m already thankful for you to provide the Chile version of it. Interesting use of the code. Thanks again :slight_smile:

1 Like

I keep these bits of code in a Notepad File . There is no formatting in that App .I think they have similar on a Mac . But always on Windows . So I can copy and paste them into the watch Layers . I can assure you I would be able to do Nothing without Copy and Paste .
It is a pleasure to help someone who gets back with some appreciation . If you ever felt Inclined to give any credit in your description, as far as I am concerned , it should be to My Friends on the Community .