|
caluculate day of week given present date and number of days
Hi,
I need to write a function in c++ that calculates expiry date of inventory, based on received date and warranty period.
so inputs to function are:-
Date recieved = "10/31/2005" (string)
Warranty period (num of days)= 30 (long)
so output should be "11/29/2005" (string)
i.e "10/31/2005" + 30 days = "11/29/2005"
similarly, 12/31/2005 + 7 days = 01/06/2006
09/11/2005 + 30 days = 10/10/2005
10/31/2005 + 90 days = 01/28/2006
string calculate_expiry_date(string date_recieved, long warranty_period)
{
string date_expire;
return date_expire;
}
Can any one please tell me the logic, are direct me to a web link, were I can find code for this logic from scratch in c++, C or Java or any other link that helps me to develop this.
Are there any c++ libraries available for this caluculation?
Thanks,
|