Make datetime format independent from current locale

Thanks for Andrei Dziahel for the patch

(cherry picked from commit d5f5b698ba592457e3a8e99878c871d559f01a2c)