java.util.Date value changes after takes from constructor in android

I passing java.util.Date value to a fragment through arguments

From constructor of the fragment i get the correct value which i passed from previous class

but in onCreateView the java.util.Date value becomes current value

here is my code

Date mydate;
 public GraphDashboardDatedFragment(Date selectedDate) {

    this.mydate=selectedDate;
    Log.v("DateBeforePassing",selectedDate.toString());

}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    view= inflater.inflate(R.layout.fragment_date_dashboard_graph, container, false);
    Log.v("DateAfterPassing",mydate.toString());


    return view;
}

and here is my log file

10-12 01:06:15.220 24456-24456/? V/DateBeforePassing: Sat Oct 13 10:45:00 GMT+05:30 2018
10-12 01:06:15.240 24456-24456/? V/DateAfterPassing: Fri Oct 12 01:06:05 GMT+05:30 2018

DateAfterPassing shows always the current system time

1 answer