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?

Thanks!
Jose