DateTime is not available in our mysql production environment => replace it by rails style conditions