Fixed date time issue with pg