Invalid ID for ZoneOffset
<p>I am trying to convert from <code>java.sql.timestamp</code> to <code>OffsetDateTime</code> so that i can return <code>ISO8601</code> standard string in my rest api. I am using this code to convert from <code>timestamp</code> to <code>OffsetDateTime</code></p>

<pre><code>public static OffsetDateTime sqlTimetampeToOffsetDateTime(Timestamp ts, String timeZone)
{
    if (ts == null)
    {
        return null;
    }

    Calendar cal = Calendar.getInstance();
    cal.setTime(ts);
    ZoneOffset offset = ZoneOffset.of(timeZone);
    return OffsetDateTime.of(
            cal.get(Calendar.YEAR),
            cal.get(Calendar.MONTH)+1,
            cal.get(Calendar.DAY_OF_MONTH),
            cal.get(Calendar.HOUR_OF_DAY),
            cal.get(Calendar.MINUTE),
            cal.get(Calendar.SECOND),
            cal.get(Calendar.MILLISECOND)*1000000,
            offset);
}
</code></pre>

<p>However, the code fails at <code>ZoneOffset offset = ZoneOffset.of(timezone)</code> for value <code>Europe/Copenhagen</code>. </p>

<p>I used following code to print list of all timezones and i do see <code>Europe/Copenhagen</code> in that list</p>

<pre><code>    Set&lt;String&gt; allZones = ZoneId.getAvailableZoneIds();
    LocalDateTime dt = LocalDateTime.now();

    List&lt;String&gt; zoneList = new ArrayList&lt;String&gt;(allZones);
    Collections.sort(zoneList);

    for (String s : zoneList) {
        ZoneId zone = ZoneId.of(s);
        ZonedDateTime zdt = dt.atZone(zone);
        ZoneOffset offset = zdt.getOffset();
        int secondsOfHour = offset.getTotalSeconds() % (60 * 60);
        String out = String.format("%35s %10s%n", zone, offset);
        System.out.printf(out);
    }
</code></pre>

<p>Now I don't understand what is going on. How can i convert <code>java.sql.timestamp</code> to <code>ISO8601</code> string (i don't care if i have to use <code>OffsetDateTime</code> or not. I would prefer not to use any third party library</p>

<p><a href="http://pastebin.com/eHJKWpAv" rel="noreferrer">http://pastebin.com/eHJKWpAv</a></p>