Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Problem with date, DateList' topicStudent Support Forum > General > Archives > "Problem with date, DateList"

Next Comment >Help | Reply To Topic
Author Comment/Response
Thibault
04/27/13 3:27pm

Hi All,

When I import my data, the format of the date is dd/mm/yyyy (format for France) and I don't know how to transform my date to the format yyyy/mm/dd.

This is my code:

Needs["TimeSeries`TimeSeries`"]
TableForm[Import["C:\Downloads\S&P500.dat", "Table"]];
f = OpenRead["C:\Downloads\S&P500.dat"];
SP500 = ReadList[f, {Word, Number}];
Close[f];
date = Table[SP500[[i, 1]], {i, 1, Length[SP500]}];

Then I tried something like that:
date = Table[
DateList[date[[i]], {"Day", "Month", "Year"}], {i, 1, Length[date]}]

but it doesn't work
(DateList[{"05/06/07", {"Day", "Month", "YearShort"}}]

If someone can help me, I hope that all is clear.
Thanks for your answers

URL: ,

Subject (listing for 'Problem with date, DateList')
Author Date Posted
Problem with date, DateList Thibault 04/27/13 3:27pm
Re: Problem with date, DateList Bill Simpson 04/28/13 1:46pm
Re: Re: Problem with date, DateList Thibault 04/29/13 04:13am
Re: Re: Re: Problem with date, DateList Bill Simpson 04/29/13 3:09pm
Next Comment >Help | Reply To Topic