convert time to internal matlab format