Is there any API available for datetime conversion between different timezones similar to google map's timezone api's.
Explaination for datetime conversion between different timezones -
Given the base timezone, datetime in base timezone and target timezone, an api which returns datetime in target timezone. (Which also considers concepts like dst as well)
Edit 1 -
Based On the negative reviews received on this question, had to give some more details for the need of this question and the efforts already wasted with different approaches.
Also with this question I am Expecting to know about some online available api, which could be hit all the time rather than depending on a library like ZonedDateTime provided with java8.
Some issues with ZonedDateTime of java 8-
See below scala code -
import java.time.{LocalDateTime, ZoneId, ZoneOffset, ZonedDateTime}
import java.time.format.DateTimeFormatter
val istanbul: ZoneId = ZoneId.of("Europe/Istanbul");
val str: String = "2017-03-29 17:00:00";
val str1: String = "2017-03-24 17:00:00";
val formatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
val localtDateAndTime: LocalDateTime = LocalDateTime.parse(str, formatter);
val localtDateAndTime1: LocalDateTime = LocalDateTime.parse(str1, formatter);
val dateAndTimeInIstanbul: ZonedDateTime = ZonedDateTime.of(localtDateAndTime, istanbul );
val dateAndTimeInIstanbul1: ZonedDateTime = ZonedDateTime.of(localtDateAndTime1, istanbul );
val utcDate: ZonedDateTime = dateAndTimeInIstanbul.withZoneSameInstant(ZoneOffset.UTC);
val utcDate1: ZonedDateTime = dateAndTimeInIstanbul1.withZoneSameInstant(ZoneOffset.UTC);
System.out.println("Original date and time in a particular timezone : " + dateAndTimeInIstanbul);
System.out.println("Converted date and time in UTC : " + utcDate);
System.out.println("Origianl date and time in a particular timezone : " + dateAndTimeInIstanbul1);
System.out.println("Converted date and time in UTC : " + utcDate1);
output generated by the above code is -
```
Original date and time in a particular timezone : 2017-03-29T17:00+03:00[Europe/Istanbul]
Converted date and time in UTC : 2017-03-29T14:00Z
Origianl date and time in a particular timezone : 2017-03-24T17:00+02:00[Europe/Istanbul]
Converted date and time in UTC : 2017-03-24T15:00Z
```
Now the problem is that from 2017 to 2020 there won't be any dst considered in Istanbul, which seems like is not considered in this ZonedDateTime library.
So would like to know about some other alternate. Preferably a web based API.