Re: Date calculating software?
- To: mathgroup at smc.vnet.net
- Subject: [mg30428] Re: Date calculating software?
- From: Tom Burton <tburton at cts.com>
- Date: Fri, 17 Aug 2001 03:10:03 -0400 (EDT)
- References: <9ld133$2f3$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On Wed, 15 Aug 2001 05:24:51 +0000 (UTC), in comp.soft-sys.math.mathematica Noz NOSPAM wrote: >Is there a software program or calculator available that can eg. Add a >period of time to a date? Needs["Miscellaneous`Calendar`"] Then define DatePlus[{y_,m_,d_},{yy_,mm_,dd_}]:=DaysPlus[{y+yy+Quotient[m+mm,12,1],Mod[m+mm,12,1],d},dd] > >example, today is 14 August 2001. > >14082001 + 18 months > In[26]:= DatePlus[{2001,8,14},{0,18,0}] Out[26]= {2003, 2, 14} >or > >14082001 + 1yr, 3mths, 4 days, and produces the date 1yr, 3mths and 4 days >hence? In[24]:= DatePlus[{2001,8,14},{1,3,4}] Out[24]= {2002, 11, 18} and In[25]:= DatePlus[{2001,8,14},{1,4,24}] Out[25]= {2003, 1, 7} Tom Burton