Tutorial: Leading Zero for time in WFF

Hi all,
I saw a recent post of people discussing whether they preferred the time with a leading zero (09:10) or not (9:10). Since WFF doesn’t allow the leading zero tag for the hour (#DBZ#) anymore, I thought I would post my workaround. It is for hours only since the minute tag still works with the leading zero.

Layer setup

Layer 1: fake leading zero

Create a text layer with:

0

Opacity:

$#Db#<10?100:0$

Position this where the first digit should sit.


Layer 2: single-digit hour

Create another text layer with:

#Db#

Opacity:

$#Db#<10?100:0$

Position this where the second digit should sit.

So, for example, when the hour is 1 , Layer 1 shows 0 and Layer 2 shows 1 , making it appear as:

01

Layer 3: two-digit hour

Create a third text layer with:

#Db#

Opacity:

$#Db#>=10?100:0$

Position this where the full two-digit hour should sit.

This layer appears for hours like:

10
11
12
13
18
23

Final structure

Layer 1: 0       opacity $#Db#<10?100:0$
Layer 2: #Db#    opacity $#Db#<10?100:0$
Layer 3: #Db#    opacity $#Db#>=10?100:0$

Use the same font, size, colour, and vertical position for all three layers.

1 Like

@roycaruso
It’s faster and easier to do this. Use #Db# in one layer with the opacity of $#DTIMEFORMAT#==12?100:0$. Then make a second layer and use (floor(#Db#/10))(#Db#%10) in place of #Db# with the opacity of $#DTIMEFORMAT#==24?100:0$.

Or if you want to have a leading zero on both 12 and 24-hour just use the single layer for a leading zero with the opacity set at 100. I’ve been doing this for years now, even before WFF was a thing.

4 Likes

I actually think mine is easier haha I’ve just given the walkthrough so newcomers can understand, and yes this is for a leading 0 for both 24 and 12 hour, depending on the user preference :blush:

2 Likes

What is wrong with: $#Db#<10?0#Db#:#Db#$:#DmZ#

1 Like