Code example for Date

Methods: setTime

0
    public void setDateTime(Date dateTime) {
        long time = dateTime.getTime();
        if (mDate == null) {
            mDate = new Date(time);
        } else { 
            mDate.setTime(time);
        } 
    } 
 
    public String toString() {
        return "From: " + mFrom.getScreenName() + " To: " + mTo.getScreenName()
                + " " + mBody;
    } 
 
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(mId);
        AddressParcelHelper.writeToParcel(dest, mFrom);
        AddressParcelHelper.writeToParcel(dest, mTo);
        dest.writeString(mBody);
        dest.writeLong(mDate == null ? -1 : mDate.getTime());
    }