MathGroup Archive 2004

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

Search the Archive

Re: Converting Dates to Mathematica Format


d = "15/10/2004";

Reverse[ToExpression[
    StringReplace["{" <>d<>"}", "/"->","]]]

{2004,10,15}


Bob Hanlon

> 
> From: Gregory Lypny <gregory.lypny at videotron.ca>
To: mathgroup at smc.vnet.net
> Date: 2004/11/09 Tue AM 01:37:27 EST
> To: mathgroup at smc.vnet.net
> Subject: [mg52095] [mg52070] Converting Dates to Mathematica Format
> 
> 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
> 
> 


  • Prev by Date: importing bmp images
  • Next by Date: Re: Poles and Complex Factoring
  • Previous by thread: Re: Converting Dates to Mathematica Format
  • Next by thread: Re: Converting Dates to Mathematica Format