Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
21
Reply
How to compare time from current time in C#
Shourya Verdhan
Apr 16 2013 2:30 PM
16k
Reply
HI,
I am making a payroll software where i want to add a function for attendance where when a employee Login his time will save in Database but if Employee is 20 Mint. Late from their shift time it will automatic create Half Day. I added this code there.
private void btntimecheck_Click(object sender, EventArgs e)
{
if (System.DateTime.Now.Hour >= 10)
{
lbltimecheck.Text = "On Time";
}
else
{
lbltimecheck.Text = "Late";
}
}
in this code i can not compare minutes. like 10:20 i can compare only hours.
so please any one know its solution please give me that code.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
21
)
Next Recommended Forum
How to pass dynamic column name for excel sheet in c#?
Updating a Database using Data Grid