[Form] Update DateTime objects only if the actual value has changed
bug #10151 [Form] Update DateTime objects only if the actual value has changed (peterrehm)

This PR was squashed before being merged into the 2.3 branch (closes #10151).

Discussion
----------

[Form] Update DateTime objects only if the actual value has changed

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Right now the Form component replaces DateTime fields with new Objects, therefore the hash is changing.
This leads to unnecessary database updated when working with doctrine. With this patch the DateTime object
of the actual entity is only replaced if the value has been changed.

Commits
-------

1f22d3a [Form] Update DateTime objects only if the actual value has changed