modified scope of convertTime function