how add recent date

i'm creating a program which ask date of breath and tell is age in days,mins,Sec, etc.
but how to subtract date.
example
Enter ur Date of breath(8/5/1999)
day=4745
hour=13880
so on
but how to recent date automatically add.
e.g user enter his age program subtract his age from recent date
Do u mean date of birth ?

Duno what this means....sry..
 
but how to recent date automatically add.


Also don't know what u mean by 'recent date'...post some code or more info ?
closed account (o3hC5Di1)
Hi there,

I believe what Mr. Zu007 is trying to ask is that he wants to writ a program which take a date of birth as input and which then outputs his age in days, hours and minutes.

"recent date" is presumable the current moment, i.e. time()

Unfortunately I have no experience in this, but i googled up some more information for you until one of the experts can shed their light on this.

http://objectmix.com/c/39018-subtract-two-dates.html
http://bytes.com/topic/c/answers/214819-date-arithmetic

If you use Visual c++:
http://msdn.microsoft.com/en-us/library/system.datetime.subtract%28v=vs.71%29.aspx

Hope that helps.

All the best,
NwN
Topic archived. No new replies allowed.