So i save the time-stamp as a Date object and a timezone as a TimeZone object.
Now i want to make a function that takes a Date object and a TimeZone object as argument and returns a Date object adjusted using the time-stamp.
For example :
Input :
Date TimeZone 12:00 Moscow Standard Time (UTC+3)
Output :
Date 3:00
Edit:
Removed Note about Calendar
A
java.util.Dateis an absolute point in time. 0900 hours UTC and 1200 hours UTC+3 are the exact samejava.util.Dateobject. There is no ‘adjustment’ to be made to it in order to represent one or the other.To get the human readable representation accounting for a particular timezone, you can set a timezone on a
DateFormatobject.Solution for the question posed in comment: