Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Converting Dates to Mathematica Format

  • To: mathgroup at smc.vnet.net
  • Subject: [mg52093] Re: Converting Dates to Mathematica Format
  • From: David Bailey <dave at Remove_Thisdbailey.co.uk>
  • Date: Wed, 10 Nov 2004 04:45:49 -0500 (EST)
  • References: <cmpq66$mot$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Gregory Lypny wrote:
> Hello Everyone,
> 
> Is there a simple way to convert dates imported as "Day/Month/Year" to 
> the Mathematica format of {Year, Month, Day}?  My dates are one column 
> in a matrix of data.  Mathematica appears to be treating them as 
> strings.  I used StringReplace to turn 15/10/2004 to 15,10,2004 but it 
> remains a string, of course.
> 
> Any suggestions would be most appreciated.  My alternative is to import 
> all of the dates as 20041510 so the ordinal ranking is maintained by 
> date calculations would not be possible.
> 
> 	Greg
> 
If you concatenated a { on the front of your date with commas and } on 
the end you would have a string representing a Mathematica list - which 
you could convert into a real list using ToExpression.

David Bailey


  • Prev by Date: Re: nonlinear programming with differential-algebraic constraints
  • Next by Date: importing bmp images
  • Previous by thread: Re: Converting Dates to Mathematica Format
  • Next by thread: Re: Converting Dates to Mathematica Format