01:01:01, can I make a timer like this?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By bgegg

i make timer by this tutorial.
but this type is like this.

1:1:1

can i add zero?

extends RichTextLabel

var s = 0
var m = 0
var h = 0

func _process(delta):
	if s > 59:
		m += 1
		s = 0
	if m >59:
		h += 1
		m = 0
	
		
	
	set_text(str(h) + ":" + str(m) + ":" + str(s))


func _on_Timer_timeout():
	s += 1
:bust_in_silhouette: Reply From: jandrewlong

Using format strings ( GDScript format strings — Godot Engine (3.1) documentation in English ):
set_text("%02d:%02d:%02d" % [h, m, s])

Thank you
I didn’t know the format

bgegg | 2019-11-04 20:56