Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8323 > unrolled thread

Re: creation of date list

Started byMichael Stern <nycstern@gmail.com>
First post2012-02-04 11:27 +0000
Last post2012-02-04 11:27 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: creation of date list Michael Stern <nycstern@gmail.com> - 2012-02-04 11:27 +0000

#8323 — Re: creation of date list

FromMichael Stern <nycstern@gmail.com>
Date2012-02-04 11:27 +0000
SubjectRe: creation of date list
Message-ID<jgj4nm$msd$1@smc.vnet.net>
You can force a date format with DateString[], so one way to do what you 
want would be

numberOfDays = DateDifference["01/02/1901", "12/13/1991"];

Map[DateString[#, {"Month", "/", "Day", "/", "Year"}] &,
 Table[DatePlus["01/02/1901", i], {i, 0, numberOfDays}]]


Note however that this date format (Month/Day/Year) is often not the 
best, as the convention in some countries is (Day/Month/Year), and many 
dates are ambiguous in this format. I try to keep everything as 
datelists until final presentation, and to avoid ambiguous formats even 
then if possible.



On Feb 3, 2012, at 2:12 AM, shippee 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.
>
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web