You can actually compare dates directly, without first converting them to integers.