Package org.goda.time

Examples of org.goda.time.MutableDateTime


                    cParseCache.put(locale, innerMap);
                }
                Object[] array = (Object[]) innerMap.get(iFieldType);
                if (array == null) {
                    validValues = new HashSet<String>(32);
                    MutableDateTime dt = new MutableDateTime(0L, DateTimeZone.UTC);
                    Property property = dt.property(iFieldType);
                    int min = property.getMinimumValueOverall();
                    int max = property.getMaximumValueOverall();
                    if (max - min > 32) {  // protect against invalid fields
                        return ~position;
                    }
View Full Code Here


        return normalizedText.trim();
    }

    private static MutableInterval doMilitaryTime(String text, Options options) {
        MutableDateTime time = new MutableDateTime();
        String[] values = text.split(":");
        time.setHourOfDay(Integer.parseInt(values[0]));
        time.setMinuteOfHour(Integer.parseInt(values[1]));

        if (time.isAfterNow() && (options.getContext() == PointerType.PAST)) {
            time.addDays(-1);
        }

        MutableInterval result = new MutableInterval(time, time);
        result.setStart(time);
        result.setEnd(time);
View Full Code Here

            return iWithUTC;
        }

        DateTime lowerLimit = iLowerLimit;
        if (lowerLimit != null) {
            MutableDateTime mdt = lowerLimit.toMutableDateTime();
            mdt.setZoneRetainFields(zone);
            lowerLimit = mdt.toDateTime();
        }

        DateTime upperLimit = iUpperLimit;
        if (upperLimit != null) {
            MutableDateTime mdt = upperLimit.toMutableDateTime();
            mdt.setZoneRetainFields(zone);
            upperLimit = mdt.toDateTime();
        }
       
        LimitChronology chrono = getInstance
            (getBase().withZone(zone), lowerLimit, upperLimit);
View Full Code Here

            return iWithUTC;
        }

        DateTime lowerLimit = iLowerLimit;
        if (lowerLimit != null) {
            MutableDateTime mdt = lowerLimit.toMutableDateTime();
            mdt.setZoneRetainFields(zone);
            lowerLimit = mdt.toDateTime();
        }

        DateTime upperLimit = iUpperLimit;
        if (upperLimit != null) {
            MutableDateTime mdt = upperLimit.toMutableDateTime();
            mdt.setZoneRetainFields(zone);
            upperLimit = mdt.toDateTime();
        }
       
        LimitChronology chrono = getInstance
            (getBase().withZone(zone), lowerLimit, upperLimit);
View Full Code Here

     * Get this object as a MutableDateTime in the same zone.
     *
     * @return a MutableDateTime using the same millis
     */
    public MutableDateTime toMutableDateTime() {
        return new MutableDateTime(getMillis(), getZone());
    }
View Full Code Here

     * Get this object as a MutableDateTime using ISOChronology in the same zone.
     *
     * @return a MutableDateTime using the same millis with ISOChronology
     */
    public MutableDateTime toMutableDateTimeISO() {
        return new MutableDateTime(getMillis(), ISOChronology.getInstance(getZone()));
    }
View Full Code Here

     * @return a MutableDateTime using the same millis
     */
    public MutableDateTime toMutableDateTime(DateTimeZone zone) {
        Chronology chrono = DateTimeUtils.getChronology(getChronology());
        chrono = chrono.withZone(zone);
        return new MutableDateTime(getMillis(), chrono);
    }
View Full Code Here

     *
     * @param chronology chronology to apply, or ISOChronology if null
     * @return a MutableDateTime using the same millis
     */
    public MutableDateTime toMutableDateTime(Chronology chronology) {
        return new MutableDateTime(getMillis(), chronology);
    }
View Full Code Here

                    cParseCache.put(locale, innerMap);
                }
                Object[] array = (Object[]) innerMap.get(iFieldType);
                if (array == null) {
                    validValues = new HashSet(32);
                    MutableDateTime dt = new MutableDateTime(0L, DateTimeZone.UTC);
                    Property property = dt.property(iFieldType);
                    int min = property.getMinimumValueOverall();
                    int max = property.getMaximumValueOverall();
                    if (max - min > 32) {  // protect against invalid fields
                        return ~position;
                    }
View Full Code Here

                if (iOffsetParsed && bucket.getZone() == null) {
                    int parsedOffset = bucket.getOffset();
                    DateTimeZone parsedZone = DateTimeZone.forOffsetMillis(parsedOffset);
                    chrono = chrono.withZone(parsedZone);
                }
                return new MutableDateTime(millis, chrono);
            }
        } else {
            newPos = ~newPos;
        }
        throw new IllegalArgumentException(FormatUtils.createErrorMessage(text, newPos));
View Full Code Here

TOP

Related Classes of org.goda.time.MutableDateTime

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.