Working with time durations

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
DateTime loginTime = DateTime.Parse("11/30/2005 7:30 AM") ;
DateTime notifyTime = loginTime.AddMinutes(90);
Console.WriteLine(notifyTime.ToLongTimeString()) ;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top