In some countries date has MM/DD/YY format, in some it is DD/MM/YY or even YY/DD/MM. Is there specific tag to be checked in $?:_ statement?
What I’ve been doing and I haven’t gotten any complaints “yet” about is a 12/24 hour opacity tag. I use $#DTIMEFORMAT#==12?100:0$ for 12 hour with MM/DD/YY in text or all numbers. For 24 hour I use $#DTIMEFORMAT#==24?100:0$ with the DD/MM/YY in text form or YY/MM/DD in number form.
I supposed 12/24 time format can be used to define date format but I was not sure. Your response gave me sureness. Thanx.
Another one close question. How to debug this? I do now see option for temporary change 12/24 system. What if I made error in conditional expression? I cannot see how it work in all cases. Is any ability temporary change in Facer editor the time system, time zone, country?
The time zone and country is automatic in Facer. The only way to debug it is switching from 12 hour to 24 hour using Facer Creator. As far as I know there is no way to use the person’s location to switch date formats in Facer.
Thanx for help. But country setting absence is bad. I tried debug indication for AM/PM time period. I used simple expression:
$#DTIMEFORMAT#==12?"#Da#":""$
After I switched to 12-hours time format - what do you think I saw? AM/PM? Nope… I saw words for selected time period “night”, “morning”, “day”, “evening” but in my native language. All with lowercase letters. If only I could select some other country as UK for example - I would see AM/PM. But I can’t. I can’t test this properly.
For AM/PM I use $#DTIMEFORMAT#==12?#Da#:#Dz#$ which in 12 hour mode shows AM/PM and in 24 hour mode shows the Time Zone. Unfortunately Samsung watches will not recognize the #Dz# tag and will be blank, but it works great on my TicWatch E I use for testing. On my Samsung watch it doesn’t show anything in 24 hour mode so at least it isn’t showing junk and is usable. By the way if you want to force your design to use AM/PM, put this in the text box of new text element.
$#Da#==AM?AM:PM$
The above expression will force it to write AM or PM using the #Da# tag. Then you can use $#DTIMEFORMAT#==12?100:0$ in opacity to hide it in 24 hour mode.
Keep in mind that those string tags are localized, where i live, it is “am.” and “pm.” (with the dot), so this will fail
Better to check if time is before or after noon.
That seems to be the main issue. Everyone in different locations either use AM or am or am. or even nothing when using 24 hour. It’s the same with the date order, everyone does it a little different. It’s just impossible to design a watch face that takes in account every different version that people use worldwide. At least until everyone starts using wrist sun dials.
How to do that? If #DTIMEFORMAT#==12 then time has the same values before and afternoon. The only difference is AM/PM value but tag #Da# has different values in different countries. Even in different countries with 12H format it can have different values. AM, am., am, a.m., what else? It is needed check for them all. How can I know them all? How can I debug them all? In docs only AM and PM values used. Nothing about any different values. If only there was tag something like #DAFTERNOON# containing false if time is before or true is after. This would be independent from local representation. But such tag does not exist.
you would use the #DH#
tag, it is the hour in 0-23 format (regardless of user setting):
$#DH#<12?AM:PM$
Indeed?..
And then there is also:
Morning: $#DH#<12?100:0$
Afternoon: $#DH#>11&&#DH#<18?100:0$
Evening: $#DH#>=18?100:0$
You can see it in a face I will be publishing in a few days. I have it saying Good Morning/Afternoon/Evening as the time calls for on wake, and then it fades out.
Thanx for the confirmation. I have already used it in my 4 first watchfaces. I almost ready publish them.
But some other issues found. When I use
$#DTIMEFORMAT#==12?"#DhZ#":"#DHZ#"$:#DmZ#:#DsZ#
double quotes appear in face (only on whatches - but not in web-Creator). If I remove quotes
$#DTIMEFORMAT#==12?#DhZ#:#DHZ#$:#DmZ#:#DsZ#
Then leading zero disappears from hour. PS: Hmmm… looks like it disappears only in web-creator, not on watches.
Almost same with date
$#DTIMEFORMAT#==12?"#DMM#/#DdL#/#Dyy#":"#DdL#/#DMM#/#Dyy#"$
appears with proper date but with quotes in watches (they absent in web-Creator)
$#DTIMEFORMAT#==12?#DMM#/#DdL#/#Dyy#:#DdL#/#DMM#/#Dyy#$
calculates floating division mounth by day then by year. PS: Wery funny… Division appears only in web-creator, not watches.
Another one issue - week day name. Without ability temporary change country I do not see how debug this.