MathGroup Archive 2008

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

Search the Archive

Re: list of dates


Roger Nye wrote:

>Hi,
>I have a list of dates in the format YYYY-MM-DD and I want to convert them 
>to a decimal value, so 1963-01-01 goes to 63.0 and 1985-07-01 goes roughly 
>to 85.5.
>
>Any suggestions on the best way to do this?
>
>Many thanks
>Roger 
>
>  
>
Perhaps Developer`CalendarData may help:

In[102]:= Developer`CalendarData[{1985, 7, 1}, "TimeInYear"]

Out[102]= 0.49589

An alternative is to use DateDifference:

In[103]:= DateDifference[{1985, 1, 1}, {1985, 7, 1}, "Year"]

Out[103]= {0.49589,Year}

Carl Woll
Wolfram Research


  • Prev by Date: Re: Wolfram Workbench user experiences
  • Next by Date: Re: Axes at the origin, for 3D plots/graphs
  • Previous by thread: list of dates
  • Next by thread: Re: list of dates