Port #436 to QDateTime

Fixes compilation under windows