converting time to ruby datetime