Updated how datetime is handled