core: fix datetime conversion of date tuples (without time)

(cherry picked from commit 39c19983cd2a8c9356f1152cafff930da32aa1fa)