#Will this work (c#)
1 messages Β· Page 1 of 1 (latest)
This isn't the best way to compare times, but your code is incorrect. You should use it like this:
// Get the current time
string time = DateTime.Now.ToString("H:mm:ss");
// Check if the time matches 1:00:59
if (time == "1:00:59")
{
// Your code here for when the time matches
}