/** * @param instant instant from 1970-01-01T00:00:00 local time * @return instant from 1970-01-01T00:00:00Z */ private long localToUTC(long instant) { DateTimeZone zone = getZone(); int offset = zone.getOffsetFromLocal(instant); instant -= offset; if (offset != zone.getOffset(instant)) { throw new IllegalArgumentException( "Illegal instant due to time zone offset transition: " + DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SSS").print(new Instant(instant))); } return instant; }