I\'m converting a String to a date, then converting it integer value to make the comparison between dates easier. Here\'s my code:
SimpleDateFormat format =
date.getTime() returns a long. If you cast it to int, it may become negative due to overflow.
date.getTime()
long
int
If you change your code to :
long lastModifiedDate = date.getTime();
You'll get a positive value - 1317580706000 - which can't fit in an int variable.