How to extract a Date from an SQLDateTime object in Mathematica

Posted by andrews on Stack Overflow See other posts from Stack Overflow or by andrews
Published on 2010-03-18T15:52:56Z Indexed on 2010/03/18 16:21 UTC
Read the original article Hit count: 704

Filed under:
|

I am trying to do a plot of a time series with DateListPlot. I want to feed it a time series I obtain from an SQL database. When I retrieve the time series the list is composed of SQLDateTime entries that DateListPlot doesn't understand.

In[24]:= t=SQLExecute[conn, "select timestamp,value from timeseries order by timestamp asc"]

Out[24]={{SQLDateTime[{2010,1,1}],12.3},{SQLDateTime[{2010,1,2}],12.51}}

Doesn't work: In[25]:= DateListPlot[t]

DateListPlot requires a Date tuple and doesn't understand SQLDateTime. What can I do?

© Stack Overflow or respective owner

Related posts about sqldatetime

Related posts about mathematica