I have two programs that are in two servers. Program A is in UK server and Program B in USA server.
I need to pass a date object from Program A to Program B. But when I get the date object from program B, I receive it with the Time Zone Conversion. How can I pass a date object from one server to another without applying this Time Zone conversions.
Note : I know that this thing can be done through Calender objects as follows. But in my case I want to use Date objects.
In Program B :
Date checkInDate = new Date(cal1.get(Calendar.YEAR) - 1900 , cal1.get(Calendar.MONTH) , cal1.get(Calendar.DATE), cal1.get(Calendar.HOUR_OF_DAY), cal1.get(Calendar.MINUTE), cal1.get(Calendar.SECOND));
Date checkOutDate = new Date(cal2.get(Calendar.YEAR) - 1900 , cal2.get(Calendar.MONTH) , cal2.get(Calendar.DATE), cal2.get(Calendar.HOUR_OF_DAY), cal2.get(Calendar.MINUTE), cal2.get(Calendar.SECOND));
Since I am implementing Serializable, I found that I can use following method too.