471,325 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 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 3640
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by CDF | last post: by
2 posts views Thread by DWalker | last post: by
3 posts views Thread by Stephen Chaplin | last post: by
11 posts views Thread by lenygold via DBMonster.com | last post: by
241 posts views Thread by jrdacc.i | last post: by
reply views Thread by rosydwin | last post: by

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.