Re: creation of date list
- To: mathgroup at smc.vnet.net
- Subject: [mg124769] Re: creation of date list
- From: Ray Koopman <koopman at sfu.ca>
- Date: Sat, 4 Feb 2012 06:34:45 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <jgg1gp$bpp$1@smc.vnet.net>
On Feb 2, 11:14 pm, shippee <slship... at gmail.com> wrote:
> I need to create a list of dates which runs from:
>
> 01/02/1901
> 01/03/1901
> 01/04/1901
> ...
> 12/11/1991
> 12/12/1991
> 12/13/1991
>
> but end up with a list of all those dates without the forward slash
> "/" - any thoughts on the best way to approach this with Mathematica?
> Please & Thanks in advance.
StringTake["0"<>ToString@#,-8]& /@ (DaysPlus[{1901,1,2},#]& /@
Range[0,DateDifference[{1901,1,2},{1991,12,13}],563].{1,1*^6,1*^4})
{"01021901","07191902","02021904","08181905","03041907","09171908",
"04031910","10181911","05031913","11171914","06021916","12171917",
"07031919","01161921","08021922","02161924","09011925","03181927",
"10011928","04171930","11011931","05171933","12011934","06161936",
"12311937","07171939","01301941","08161942","03011944","09151945",
"04011947","10151948","05011950","11151951","05311953","12151954",
"06301956","01141958","07311959","02131961","08301962","03151964",
"09291965","04151967","10291968","05151970","11291971","06141973",
"12291974","07141976","01281978","08141979","02271981","09131982",
"03291984","10131985","04291987","11121988","05291990","12131991"}
To get all the days, delete the ",563" in the code.