the LocalDateTime/LocalDate value maybe null, so need check it firstly. if it's null, could return NullLiteral directly.