TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
durga prasad
NA
54
0
Date time pickers
Aug 4 2008 2:28 AM
Hi,
I have a problem in a project , in this project I used intime and outtime as two fields(Datetime pickers), on outtime textchanged event it had to calcualte outtime - intime - 30min(Lunchtime) and display it in a text box.In case if the employee works more than 8:30 hours .For example 12 hours than it has to calculate like Extra hours = Total hours worked - (min hours woked +lunch hours) eg., extrahours 12 - (8:30+30) -> 12 - 9 -> 3 hours , then in another text box it has to display 3 hours as extra hours worked.
I used double and time spans buts its not working out, please help me out.
String tot = String.Empty;
TimeSpan ts = new TimeSpan();
ts = dtpouttime.Value.TimeOfDay - dtpintime.Value.TimeOfDay;
txtworkedhours.Text = ts.ToString();
txtworkedhours.Text = Convert.ToDouble(Convert.ToDouble(ts.Hours - 0.50) + (Convert.ToDouble(ts.Minutes) / 60.00)).ToString("#.00");
Thanks in Advance,
Prasad
Reply
Answers (
4
)
custom plus minus control infront of every node in a treeview
Windows application