im having problem setting the time of aftternoon login that should be 12:31pm to 4:59pm
When i try to exucute the afternoon login where i change the time it gives me not recorded the else statement
DateTime date = DateTime.Now;
// 0:00 to 11:59
if (date.Hour >= 0 && date.Hour <= 11) {
MessageBox.Show("Morning Login");
}
// 12:00 between 0 minutes and 30
else if (date.Hour == 12 && date.Minute >= 0 && date.Minute <= 30) {
MessageBox.Show("Morning Logout");
}
// This is the condition I'm having problems with
else if (date.Hour == 12 || date.Hour >= 13 && date.Hour <= 16) {
// I'm setting the time to afternoon login that should be 12:31pm to 4:59pm
MessageBox.Show("Afternoon Login");
}
else if (date.Hour >= 17 && date.Hour <= 23)
{
MessageBox.Show("Afternoon Logout");
}
else
{
MessageBox.Show("Not recorded");
}