Package org.joda.time

Examples of org.joda.time.IllegalInstantException


        public long set(long instant, int value) {
            long localInstant = iZone.convertUTCToLocal(instant);
            localInstant = iField.set(localInstant, value);
            long result = iZone.convertLocalToUTC(localInstant, false, instant);
            if (get(result) != value) {
                IllegalInstantException cause = new IllegalInstantException(localInstant,  iZone.getID());
                IllegalFieldValueException ex = new IllegalFieldValueException(iField.getType(), Integer.valueOf(value), cause.getMessage());
                ex.initCause(cause);
                throw ex;
            }
            return result;
        }
View Full Code Here


    private long localToUTC(long localInstant) {
        DateTimeZone zone = getZone();
        int offset = zone.getOffsetFromLocal(localInstant);
        localInstant -= offset;
        if (offset != zone.getOffset(localInstant)) {
            throw new IllegalInstantException(localInstant, zone.getID());
        }
        return localInstant;
    }
View Full Code Here

TOP

Related Classes of org.joda.time.IllegalInstantException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.