Originally posted by Rajesh MadhanGopal:
DateA would have IST timestamp and DateB would have CST time stamp.
No, there's a mistake. Class Date doesn't know anything about time zones. It just stores a number of milliseconds since 1 January 1970 in the GMT timezone (see the API documentation of class java.util.Date).
Class Calendar does know about time zones - it has methods setTimeZone(...) and getTimeZone() to set and get the time zone. Note that if you use setTime(...) and getTime() on a Calendar, to set the time using a Date object or get the time as a Date object, those Date objects will always be in GMT, no matter what you set the time zone of the Calendar object to.
If you want to see what the time of a Calendar object is set to in the time zone of the Calendar, try this:
[ August 17, 2006: Message edited by: Jesper Young ]