I want to convert the current date to integer value. By default, it returns long. When I try to convert long to integer, and afterwards I convert the integer value to date,
Your Problem is because of getTime() . it always return following.
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.
Because the max integer value is less then the return value by getTime() that why is showing wrong result.
getTime()