# Dual Time with a twist (can it be done?)

I have searched and searched and tried so many different ideas that people have written - nothing so far works. It sounds like a simple problem though…
I line in Australia. I have a friend who lives in Newfoundland and I want to make a simple watch face that shows both my local time (digital) and the time in Newfoundland. Sounds simple, and there’s heaps of help - EXCEPT… Newfoundland is -13.5Hrs from UTC. I can get everything to work that are whole number hours (-13 or -12) but can’t for the life of me get a display that will work without error when the timezone offset is 13 and a half hours. When the minutes are less than 30, it displays negative numbers instead of taking the hour back and showing the correct minutes. Example: My time is say 10:25am, Newfoundland time would be 8:55pm, but it displays 9:-5.
If anyone has figured this out I would be so gratefull for guidance please guys.

Can you post your codes that are resulting in that example’s output please?

I think the following will work.

In the expressions, replace UTC_OFFSET with your desired time zone.

minutes:
(floor((((#DUm#+#DUs#/60)+UTC_OFFSET*60)+720)%60))

hours:
(floor((((#DUh#+#DUm#/60+#DUs#/3600)+UTC_OFFSET)+12)%12))

Note that the constants being added ( 720 and 12 ) are used to make sure the expressions are +ve even when the time zone is the most negative ( ie. when UTC_OFFSET = -12 ).

2 Likes

I have kept the digital hours and minutes seperate for ease.
Hours: \$(#DHZ#-13)<1?(#DHZ#+10):(#DHZ#-13)\$:
Minutes: \$(#DmZ#-30)<0?(#DmZ#+30):(#DmZ#-30)\$
These both solve the negative number issue but still don’t fix the issue of the hour number not going back when the minutes are changed to the 30-59 ranged.

This string doesn’t seem to work - the result is a blank.
What does the expression ‘floor’ do please? I can’t find a reference to it.
PS: I am working on a dual DIGITAL face not an analogue…

Did you replace “UTC_OFFSET” in the expression with a number representing the UTC offset you want?

eg.

`````` (floor((((#DUm#+#DUs#/60)+UTC_OFFSET*60)+720)%60))
``````

becomes

``````(floor((((#DUm#+#DUs#/60)+4.5*60)+720)%60))  if the desired time zone is UTC+4.5
``````

The expressions used in Facer ( including the Floor function ) can be found here: