Date conversion

Hi! We are tryint to access time data stored in an SQL The

    > query returns a date object of type DbiDate. When printed,
    > we get a nicely formatted text date. If cast into a float or
    > int, you get the number of seconds elapsed since
    > 1/1/1970. The way we are dealing with the conversion from
    > this format into MPL format is:through time.strptime (using
    > a format string), then converting that into a datetime
    > object, and finally invoking MPL's date2num.

    > Is there a better, quicker more obvious way to accomplish
    > this?

Seconds since 1/1/1970 is often called "seconds since the epoch" and
mpl provides a conversion routine for dates in this form

  from matplotlib.dates import epoch2num

  e = int(mydate) # convert your date to seconds since epoch
  d = epoch2num(e) # a mpl datenum

epoch2num also works over arrays or sequences of epochs.