I am trying to make one of my Parcelable classes, and one of its attributes is a Date object.
In the writeToParcel () method, I have:
out.writeLong(myDate.getTime());
And in my createFromParcel () method, I have
person.setDate(new Date(in.readLong() * 1000));
The object that I pass to my intention has a date created as follows:
new Date(2000,12,06)
But, when I read it on the other hand, in another activity:
myDate.getYear()+"-"+myDate.getMonth()+"-"+myDate.getDay()
He prints "2001-0-0"
I assume that something is being wound up during the sending process?
source share