Adding leading zero to single digiits in single digit numbers (1-9)

How can i make DateTime.Today.Month.ToString value to have leading zero on it because if i use this it only shows 9 instead of 09

@Genmelford_Bautista
welcome to the forum

have a look here:
grafik

give a try on DateTime.Today.toString("MM")

Use String.PadLeft. More details here:

Solution:
Assign → monthAsString.PadLeft("2", CChar("0"))

1 Like