473,770 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

get date

I have an application that allows the user to pick a start date, then the
enter in a number of hours to do a job, then a stop date fills out a
textbox. Is there a way to find out the stop date?
if they pick 7/11/08 and enter in 10 hours for a job, how can I figure out
the actual date the job should end?
Jul 21 '08 #1
10 2584
"Scott" <ii*@gmail.comw rote in message
news:uf******** ******@TK2MSFTN GP03.phx.gbl...
I have an application that allows the user to pick a start date, then the
enter in a number of hours to do a job, then a stop date fills out a
textbox. Is there a way to find out the stop date?
Yes.
If they pick 7/11/08 and enter in 10 hours for a job, how can I figure out
the actual date the job should end?
Depends what time the job starts. Does it start the moment the user presses
the button, or does it start at 00:00?

Anyway, all you really need is the AddHours(10) method of the DateTime
structure:
http://msdn.microsoft.com/en-us/libr....addhours.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 21 '08 #2
There is no particular time for the job to start. The user is only picking
the day which it will start and how many hours it will take to do the job.
"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:ex******** ******@TK2MSFTN GP05.phx.gbl...
"Scott" <ii*@gmail.comw rote in message
news:uf******** ******@TK2MSFTN GP03.phx.gbl...
>I have an application that allows the user to pick a start date, then the
enter in a number of hours to do a job, then a stop date fills out a
textbox. Is there a way to find out the stop date?

Yes.
>If they pick 7/11/08 and enter in 10 hours for a job, how can I figure
out the actual date the job should end?

Depends what time the job starts. Does it start the moment the user
presses the button, or does it start at 00:00?

Anyway, all you really need is the AddHours(10) method of the DateTime
structure:
http://msdn.microsoft.com/en-us/libr....addhours.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 21 '08 #3
"Scott" <ii*@gmail.comw rote in message
news:uH******** ******@TK2MSFTN GP04.phx.gbl...

[top-posting corrected]
>>I have an application that allows the user to pick a start date, then
the enter in a number of hours to do a job, then a stop date fills out a
textbox. Is there a way to find out the stop date?

Yes.
>>If they pick 7/11/08 and enter in 10 hours for a job, how can I figure
out the actual date the job should end?

Depends what time the job starts. Does it start the moment the user
presses the button, or does it start at 00:00?

There is no particular time for the job to start. The user is only picking
the day which it will start and how many hours it will take to do the job.
Er, so how can you possibly know when the job ends if you don't know when it
starts...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 21 '08 #4
Mark Rae [MVP] wrote:
"Scott" <ii*@gmail.comw rote in message
news:uH******** ******@TK2MSFTN GP04.phx.gbl...

[top-posting corrected]
>>>I have an application that allows the user to pick a start date,
then the enter in a number of hours to do a job, then a stop date
fills out a textbox. Is there a way to find out the stop date?

Yes.

If they pick 7/11/08 and enter in 10 hours for a job, how can I
figure out the actual date the job should end?

Depends what time the job starts. Does it start the moment the user
presses the button, or does it start at 00:00?

There is no particular time for the job to start. The user is only
picking the day which it will start and how many hours it will take to
do the job.

Er, so how can you possibly know when the job ends if you don't know
when it starts...?

Another possible problem is how many hours will the person work each
day. A job which takes 10 hours where the person works one hour a day
will have a much different end date than one where the person works a
7.5 hour work day.

To me the three details that would be necessary are start date, end date
and hours to complete the job.

Just my two cents.
LS
Jul 21 '08 #5
Its not a job such as a sql job, or anything like that, its a repair job on
a car so time isn't a factor only the number of days.

so if the user body guy enters in a start date of 7/11/2008 and enters in
the number of hours its going to take to do each task, prep, paint, etc.
such as a total of 8 hours, then they should see an end date of 7/12/2008
and so on.

"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:e4******** ******@TK2MSFTN GP03.phx.gbl...
"Scott" <ii*@gmail.comw rote in message
news:uH******** ******@TK2MSFTN GP04.phx.gbl...

[top-posting corrected]
>>>I have an application that allows the user to pick a start date, then
the enter in a number of hours to do a job, then a stop date fills out
a textbox. Is there a way to find out the stop date?

Yes.

If they pick 7/11/08 and enter in 10 hours for a job, how can I figure
out the actual date the job should end?

Depends what time the job starts. Does it start the moment the user
presses the button, or does it start at 00:00?

There is no particular time for the job to start. The user is only
picking the day which it will start and how many hours it will take to do
the job.

Er, so how can you possibly know when the job ends if you don't know when
it starts...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 21 '08 #6
Scott wrote:
Its not a job such as a sql job, or anything like that, its a repair job on
a car so time isn't a factor only the number of days.

so if the user body guy enters in a start date of 7/11/2008 and enters in
the number of hours its going to take to do each task, prep, paint, etc.
such as a total of 8 hours, then they should see an end date of 7/12/2008
and so on.

"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:e4******** ******@TK2MSFTN GP03.phx.gbl...
>"Scott" <ii*@gmail.comw rote in message
news:uH******* *******@TK2MSFT NGP04.phx.gbl.. .

[top-posting corrected]
>>>>I have an application that allows the user to pick a start date, then
the enter in a number of hours to do a job, then a stop date fills out
a textbox. Is there a way to find out the stop date?
Yes.

If they pick 7/11/08 and enter in 10 hours for a job, how can I figure
out the actual date the job should end?
Depends what time the job starts. Does it start the moment the user
presses the button, or does it start at 00:00?
There is no particular time for the job to start. The user is only
picking the day which it will start and how many hours it will take to do
the job.
Er, so how can you possibly know when the job ends if you don't know when
it starts...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Is this for a real application? Your example seems to go against what
you are saying. A job that takes lets say 10 hours, if there is prep
painting etc., the drying of the paint must occur prior to other steps
so the number of hours is not indicative of the time to do the job. And
what happens when an 'emergency' job comes in and the person/people
required to do the job are busy with other work.

Most jobs like this are charged by worktime not by the time the job will
be finished.

LS
Jul 21 '08 #7
so you take the number of hours, divide by max hours a day, to get number of
days. then add to start date. you may need to take into account non-working
days (sunday, holidays, etc).

-- bruce (sqlwork.com)
"Scott" wrote:
Its not a job such as a sql job, or anything like that, its a repair job on
a car so time isn't a factor only the number of days.

so if the user body guy enters in a start date of 7/11/2008 and enters in
the number of hours its going to take to do each task, prep, paint, etc.
such as a total of 8 hours, then they should see an end date of 7/12/2008
and so on.

"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:e4******** ******@TK2MSFTN GP03.phx.gbl...
"Scott" <ii*@gmail.comw rote in message
news:uH******** ******@TK2MSFTN GP04.phx.gbl...

[top-posting corrected]
>>I have an application that allows the user to pick a start date, then
the enter in a number of hours to do a job, then a stop date fills out
a textbox. Is there a way to find out the stop date?

Yes.

If they pick 7/11/08 and enter in 10 hours for a job, how can I figure
out the actual date the job should end?

Depends what time the job starts. Does it start the moment the user
presses the button, or does it start at 00:00?

There is no particular time for the job to start. The user is only
picking the day which it will start and how many hours it will take to do
the job.
Er, so how can you possibly know when the job ends if you don't know when
it starts...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


Jul 21 '08 #8
"Scott" <ii*@gmail.comw rote in message
news:uH******** ******@TK2MSFTN GP04.phx.gbl...

[top-posting corrected again]
>>>>I have an application that allows the user to pick a start date, then
the enter in a number of hours to do a job, then a stop date fills out
a textbox. Is there a way to find out the stop date?

Yes.

If they pick 7/11/08 and enter in 10 hours for a job, how can I figure
out the actual date the job should end?

Depends what time the job starts. Does it start the moment the user
presses the button, or does it start at 00:00?

There is no particular time for the job to start. The user is only
picking the day which it will start and how many hours it will take to
do the job.

Er, so how can you possibly know when the job ends if you don't know when
it starts...?

so if the user body guy enters in a start date of 7/11/2008 and enters in
the number of hours its going to take to do each task, prep, paint, etc.
such as a total of 8 hours, then they should see an end date of 7/12/2008
and so on.
That makes no sense...

A day isn't 8 hours long. If I start work at 8am on 11th and work for 8
hours, that doesn't make it 12th...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 21 '08 #9
Trust me guys, I have a boat load of questions to the business folks that
own the orginal application. This app is done in Excel and they wanted it
web enabled to use in more of their body shops.

Currently if the app says it takes 16 hours to complete a job, the app shows
4 days of work time on it, 4 days an hour, so for example in the current app
if the repair guy enters in a date of

7/22/2008
16 hours of total work time
the app shows 4 days
and an estimated done date is 7/25/08

unless there is a weekend involved then it calculates them and would move
over to the following week.

So if the start date was 7/24/2008 then the app would show
16 hours of work time
4 days to complete
est done date would be 7/30/2008
and then show 4 weekdays and 2 weekend days

"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:Oy******** ******@TK2MSFTN GP04.phx.gbl...
"Scott" <ii*@gmail.comw rote in message
news:uH******** ******@TK2MSFTN GP04.phx.gbl...

[top-posting corrected again]
>>>>>I have an application that allows the user to pick a start date, then
>the enter in a number of hours to do a job, then a stop date fills
>out a textbox. Is there a way to find out the stop date?
>
Yes.
>
>If they pick 7/11/08 and enter in 10 hours for a job, how can I
>figure out the actual date the job should end?
>
Depends what time the job starts. Does it start the moment the user
presses the button, or does it start at 00:00?

There is no particular time for the job to start. The user is only
picking the day which it will start and how many hours it will take to
do the job.

Er, so how can you possibly know when the job ends if you don't know
when it starts...?

so if the user body guy enters in a start date of 7/11/2008 and enters in
the number of hours its going to take to do each task, prep, paint, etc.
such as a total of 8 hours, then they should see an end date of 7/12/2008
and so on.

That makes no sense...

A day isn't 8 hours long. If I start work at 8am on 11th and work for 8
hours, that doesn't make it 12th...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 21 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5219
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much appreciated. TIA
4
5390
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and calculate days, months, and years. This is not for a college course. It's for my own personal genealogy website. I'm stumped about the code. I'm working on it but not making much progress. Is there any free code available anywhere? I know it...
2
4185
by: Tjerk | last post by:
Hello all, I have the script below to change an image depending on the date upto january it worked fine but then it just stopped working does anybody have an idea how I can make it work again or why it doesn't work? Thanks in advance Tjerk
9
2634
by: Thomas R. Hummel | last post by:
Hello, I am importing data that lists rates for particular coverages for a particular period of time. Unfortunately, the data source isn't very clean. I've come up with some rules that I think will work to clean the data, but I'm having trouble putting those rules into efficient SQL. The table that I'm dealing with has just under 9M rows and I may need to use similar logic on an even larger table, so I'd like something that can be made...
30
3695
by: Dr John Stockton | last post by:
It has appeared that ancient sources give a method for Numeric Date Validation that involves numerous tests to determine month length; versions are often posted by incomers here. That sort of code seems unnecessarily long. For some while, the following approach has been given here :- function ValidDate(y, m, d) { // m = 0..11 ; y m d integers, y!=0
3
2571
by: captain | last post by:
Below is the sql for data with same date need to extract + or - 5 days data of same date also. How to also get data of + and - days related to same date. SELECT IM.Area, IM.Location, IT.itemid, IT.date,
1
2807
by: Liz Malcolm | last post by:
Hello and TIA. I have a DE form with an option group that if daily is selected todays date is used for start and end date, if weekly is selected Monday - Friday is used. I am trying to add a manual date selection to clear the start and end date to allow the end user input other days. I have taken into account our financial 1st and last day of the month. I was able to break the option group into a select case, but I cannot get the date...
7
31841
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the current date. If not, I'd like to display the error message to ValidationSummary. It seems to make sense to me to use CompareValidator but the problem is put the current date into CompareValidator. So, I created a hidden text field in my aspx. ...
12
29469
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as follows: function doDateCheckNow(source, args) { var oDate = document.getElementById(source.controltovalidate); // dd/mm/yyyy
3
2355
by: JJ | last post by:
Here's the code. $link="http://xbox360cheat.org"; $close_date=$_POST; #last content change check if ($close_date == 0) $close_date = date("Y-m-d H:m:s", mktime(12, 0, 0, date("m"), date ("d")+7, date("Y"))); else if ($close_date == 1)
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10257
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8931
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.