Fix conversion to cdtime