473,320 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Working with time durations

Ant
Hi, I need to find out what data types I need to work with time durations &
how to add/subtract them from clock time. For example:

A customer logs in at 7:30 in the morning. I need notification 40 minutes
after the custmer has logged in. (at 8:10). It needs to work with 24 hour
time as well. Is there a data type that acts as daily time? I know datetime
but how would use that in this situation.

Many thanks for your ideas
Ant
Dec 1 '05 #1
3 3730
TimeSpan

--
Robbe Morris - 2004/2005 Microsoft MVP C#
http://robbemorris.blogspot.com

"Ant" <An*@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
Hi, I need to find out what data types I need to work with time durations
&
how to add/subtract them from clock time. For example:

A customer logs in at 7:30 in the morning. I need notification 40 minutes
after the custmer has logged in. (at 8:10). It needs to work with 24 hour
time as well. Is there a data type that acts as daily time? I know
datetime
but how would use that in this situation.

Many thanks for your ideas
Ant

Dec 1 '05 #2
DateTime loginTime = DateTime.Parse("11/30/2005 7:30 AM") ;
DateTime notifyTime = loginTime.AddMinutes(90);
Console.WriteLine(notifyTime.ToLongTimeString()) ;
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ant" wrote:
Hi, I need to find out what data types I need to work with time durations &
how to add/subtract them from clock time. For example:

A customer logs in at 7:30 in the morning. I need notification 40 minutes
after the custmer has logged in. (at 8:10). It needs to work with 24 hour
time as well. Is there a data type that acts as daily time? I know datetime
but how would use that in this situation.

Many thanks for your ideas
Ant

Dec 1 '05 #3
Ant
Great! Thanks very much!

"Peter Bromberg [C# MVP]" wrote:
DateTime loginTime = DateTime.Parse("11/30/2005 7:30 AM") ;
DateTime notifyTime = loginTime.AddMinutes(90);
Console.WriteLine(notifyTime.ToLongTimeString()) ;
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ant" wrote:
Hi, I need to find out what data types I need to work with time durations &
how to add/subtract them from clock time. For example:

A customer logs in at 7:30 in the morning. I need notification 40 minutes
after the custmer has logged in. (at 8:10). It needs to work with 24 hour
time as well. Is there a data type that acts as daily time? I know datetime
but how would use that in this situation.

Many thanks for your ideas
Ant

Dec 1 '05 #4

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

Similar topics

2
by: CDF | last post by:
In one of my tables, I have a field that has time durations in it. The field is currently in text format. Is there a way that I can convert this field into a format where I can SUM the durations? ...
2
by: DWalker | last post by:
In Visual Studio (Visual Basic) .NET 2002, I noticed that this: Dim Elapsed as DateTime = Now - Now gives a "compile time" error (error in the IDE), saying that the '-' operator is not...
3
by: Stephen Chaplin | last post by:
I'm summing up time spent on jobs over a week, some of these jobs last greater than 24 hours and when access sums these up it appears that it starts again at 00:00 once it gets past 23:59. Is it...
1
by: John Bailo | last post by:
I'm doing a profile on my SQL Server to see if I can eliminate any long running statements, and periodically, I see an entry for ".NET SqlClient Data Provider". The durations for it are very...
1
by: Joe J. | last post by:
Hi everyone, I need a little bit of help with this problem. I've got a time durations feed, which comes in this format (minutes:seconds): Example, there is only 5 values: 00:45 01:15
4
by: NormAmst | last post by:
I have a list of CPU processing times and job durations for an entire department at work. There are 3 classifications I am maintaining. CPU time during peak hours , CPU time during non peak hours...
1
by: pedalpete | last post by:
Hey Gang, More difficult to describe this than see it, so here's a link which shows the issue I'm having http://zifimusic.com/testing/broken-hovers.html I've been looking at this for quite a...
11
by: lenygold via DBMonster.com | last post by:
Hi everybody! This query is supposed to count consecutive years from the current year without OLAP. Input Table: ID DateCol 1 02/01/2006 1 01/01/2006 1 01/01/2005
241
by: jrdacc.i | last post by:
what is the difference between the tree storage durations(static,automatic and dynamic) in C?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.