Q:

How to get time zone from date

I am trying to get time zone from an existing date to use it for some other date conversion. Can someone reply with updating the todos in the below code. Appreciate any help.
Or just to make it simple is there some java api to which i give +0530 and it returns IST :)
Here is my code :
import java.text.SimpleDateFormat
import java.util.*;
import java.text.DateFormat;

SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
Date date = isoFormat.parse("2016-04-21T00:00:00+0530");

//todo print time zone 
//todo here should print IST since date is having +0530

A:

This is not possible. A Date does not have time zone information attached. It is just a point in time, internally represented as milliseconds since 1.1.1970 midnight UTC (excluding leap seconds).

A:

A java.util.Date does not have a time zone. It is a pure time in UTC. The parser converted the string to the internal value.
A java.time.ZonedDateTime (Java 8+) does have a time zone.
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("uuuu-MM-dd'T'HH:mm:ssZ");
ZonedDateTime dt = ZonedDateTime.parse("2016-04-21T00:00:00+0530", formatter);
ZoneId zone = dt.getZone();

If running Java 6 or 7, use the backport of the Java SE 8 date-time classes.
For Java 5+ use the Joda-Time library.

