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
mike Delvotti
NA
262
0
Calculate days on hours rather than date
Jul 25 2012 6:19 AM
I'm having a liitle issue with a basic hire app in calculating the hire period. I would like to show the hire period in days by calculating the hours not the dates.
As an example if somebody collects a car at 8am on Monday but returns it at 8am on tuesday this will be classed as 1 day. My currunt app thinks it's 2 days as it goes past midnight on the timedate picker.
the code below is what I'm using to calculate the days between two timedate pickers:
hire_PeriodTextBox.Text = (dateTimePicker2.Value - dateTimePicker1.Value.AddDays(-1)).Days.ToString()
the date time pickers are in this format: dd/MM/yyyy HH:mm:ss
Reply
Answers (
3
)
wcf with c#
Using word API how to insert the image at specified lication(left,right and center)?