Taping a digital "time" element to change "+ or-" hours for a 2nd time-zone?

What I would like to do is make a watch face that has a digital time element that’s adjustable plus or minus an hour at a time. Instead of having a dial that you just use to rotate for the second time zone.

So am I watch face I might have a analog main face and a digital second time zone that is adjustable and plus or minus 1 hour increments.

I’m really not a coder, so I would appreciate any assistance in the expression I would need to use. Also if you could explain the different elements and what they’re doing and why that would help me learn how to code on my own. I’ve learned how to use the variable plus or minus for rotating bezel. Although I still don’t fully understand how the expression is written with parentheses and stuff but I am familiar with at least understanding that those are the two variables I would be using. I just don’t know how to provide any code to allow the hour to increase by one or decrease by one. So I would still need the whole expression and I could learn from that a little bit as I study it.

Thank you in advance I appreciate it.

1 Like

There are tags for the UTC/GMT.
You could use #DUH#, however, adding a value to that does not really work, because you could get a time outside of our time range.

Example: if your time is 17:00, the UTC+9, should be 02:00 and not 26:00.

So, best is to do some math. The UTC hour can be calculated with the DNOW tag: (floor(#DNOW#/3.6e6)%24)

Now to add a variable #VAR_1# (UTC-11 upto UTC+12), the formula would be:
((floor(#DNOW#/3.6e6)+24+#VAR_1#)%24)

2 Likes

Yes, Thank you very much. Perfect! :slight_smile:

2 Likes

HI
I would be interested in the topic. I have some Watch Faces with digital time that you can advance or reverse 1 hour at a time.
I used this formula, which if I remember correctly the good @lucky.andrei provided to me, in the Text field
(#DH#+#VAR_2#):#DmZ#:#DsZ#
I’m realizing only now that it’s malfunctioning.
As you say if at 17.00 I get a surplus of 9 hours i have not 02.00 but 26.00
So I did a try by copying and pasting your formula into the text field, changing VAR_1 in VAR_2 that is where i have my set for + or - hours.
Unfortunately the result is the same. I have 26.00 instead of 02.00
Where am I wrong? Can you help me? Do I need to put the formula somewhere else?
I don’t understand anything about maths, so if you could help me step by step I would be really grateful.
This is a link to one of the Watch Faces with Adjustable Digital Time with Inspection On.

2 Likes

Great bit of Voodoo Tom . Unique Maths :::)))

1 Like

@diavo . I managed it the long way round but it is difficult crossing Zero . Young Tom has cracked it again .Topic Bookmarked .

1 Like

@diavo .Stick with it .I made a Test of Tom’s Formula I can not get it to Fail . I did not know we could use Scientific numbers . Brilliant .

hi @russellcresser
Thx Russell. If you find a working formula let me know. I never realized before that instead of 2.00 I would have had 26.00.
I’d like the adjustable time to work properly.
Surely if I’m reborn instead of a man of letters I want to become a mathematician. LOL :blush:

1 Like

I did a mistake, sorry the formula ((floor(#DNOW#/3.6e6)+24+#VAR_1#)%24) works perfectly, but it shows only hours.
Could you add minutes and seconds?
Thx for your help

1 Like

Sorry, i forgot. May be Hrs: Min; Sec with leading 0 ?
Thx again

1 Like

Minutes: floor(#DNOW#/6e4)%60)

For leading 0, you can use the this function: pad(number, digits)

Seconds: its universal, just use the tag available, with leading 0: #DUsZ#

1 Like

@diavo You only need to change the Hour . In your Face the minutes and seconds are covered already.
You don’t want to be getting into adjusting the minutes for time zones . There are a few that have 1/2 1/4 hrs adjustments . I would let them GO .

@tom.vannes I can not see Immediately the need for +24 in your magic then you give us more E numbers . I love 6e4.

((floor(#DNOW#/3.6e6)+24+#VAR_1#)%24)

Tx mate. Obliged :grinning:

1 Like

Thx very much for your help.
Much appreciated

2 Likes

You are right. As usual.
Many thanks

2 Likes

All it does is keeping the value positive. I first thought that if it is 0:00 then UTC-1, or VAR_1=-1, then you get a negative time, but I was wrong.

1 Like

Yeah . That is the Magic of Modulo. Great work My Friend . I am going to convert my stuff soon .

1 Like

Thx again @tom.vannes . Great thing to be a mathematician. Unfortunately, in his time, I chose another path, but as I said if I’m reborn I want to be a mathematician. LOL

2 Likes

By the way, now i will run to correct all my faces with the wrong time after midnight,
I have much appreciated your help :smiley:

2 Likes