473,561 Members | 3,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3738
TimeSpan

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

"Ant" <An*@discussion s.microsoft.com > wrote in message
news:E6******** *************** ***********@mic rosoft.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.AddMi nutes(90);
Console.WriteLi ne(notifyTime.T oLongTimeString ()) ;
--
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.AddMi nutes(90);
Console.WriteLi ne(notifyTime.T oLongTimeString ()) ;
--
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
5861
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? Help is appreciated! Thanks, Corey
2
19081
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 defined for the Date datatype. On the other hand, Dim Elapsed as DateTime = Now + Now does not give a compile time error but it thinks you're...
3
15973
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 possible to display the time taken in hours and mins past the 24 hour clock? i.e 34:23?
1
5172
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 long, the example below shows 386 seconds! I would think that whatever these are they are "gumming up" my database server. However, there is...
1
1487
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
3006
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 and total CPU time. I developed an Excel spreadsheet totaling the times and manually format a spreadsheet to present total jobs run and total CPU time...
1
1988
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 while, and can't figure out why I can't set the dropdown menus to appear above other elements which also have dropdown menus. I run multiple...
11
2630
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
6754
by: jrdacc.i | last post by:
what is the difference between the tree storage durations(static,automatic and dynamic) in C?
0
7644
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7568
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...
0
8085
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...
1
7614
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5469
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...
0
5185
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...
0
3615
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3598
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2066
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

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.