datetime: use normalization instead of redundant code