Difference between SimpleDateFormat.setTimeZone() and Calendar.setTimeZone()

calendar, java, simpledateformat

Solution

`SimpleDateFormat` will use the specified timezone during formatting, while `Calendar` will just consider the given timezone as that in which the respective date/time are specified. The Calendar's timezone will be converted into the SimpleDateFormat's timezone when formatting the Calendar instance.

Problem

What is the difference between SimpleDateFormat.setTimeZone() and Calendar.setTimeZone()?

Original source