Since you're using a 1 second timer why not check the time every tick?
EDIT:
Ok I changed my code a bit. It's still a 1 second timer (1000 milliseconds) but now when the timer tick event triggers, it only looks at the current hour and minute. Thus if your program is running a bit slow it will still run your process at 1 AM.
The global variable "lastRunDate" stores the date of when the last process run. This needs to be updated before your process runs just in case your process takes longer than a second to complete.
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private String lastRunDate = "";
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 1000;
timer1.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
if (lastRunDate != System.DateTime.Now.ToString("yyyy-MM-dd"))
{
String str = System.DateTime.Now.ToString("h:mm tt");
if (str.Equals("1:00 AM"))
{
lastRunDate = System.DateTime.Now.ToString("yyyy-MM-dd");
MessageBox.Show(str);
}
}
}
}
}