I made a script that check if the current time is equals to a string, the code is:
string ore = Properties.Settings.Default.oreChiusura;
string minuti = Properties.Settings.Default.minutiChiusura;
var t1 = DateTime.Now.ToString("HH:mm");
var t2 = ore + ":" + minuti;
if(t1 == t2)
{
//Stuff
}
the problem is, if "minuti" is like 01....09 it not work, it work only if is a number without the starting 0. What am I doing wrong?