Package org.joda.time

Examples of org.joda.time.DateTime.toDate()


        System.out.println("Add 14 mnths in field:in.monthOfYear().addWrapFieldCopy(14):  " + in.monthOfYear().addWrapFieldToCopy(14));
        System.out.println("...");
        System.out.println("Convert to Instant:   in.toInstant():           " + in.toInstant());
        System.out.println("Convert to DateTime:  in.toDateTime():          " + in.toDateTime());
        System.out.println("Convert to MutableDT: in.toMutableDateTime():   " + in.toMutableDateTime());
        System.out.println("Convert to Date:      in.toDate():              " + in.toDate());
        System.out.println("Convert to Calendar:  in.toCalendar(Locale.UK): " + in.toCalendar(Locale.UK).toString().substring(0, 46));
        System.out.println("Convert to GregCal:   in.toGregorianCalendar(): " + in.toGregorianCalendar().toString().substring(0, 46));
        System.out.println("");
        System.out.println("                      in2 = new DateTime(in.getMillis() + 10)");
        DateTime in2 = new DateTime(in.getMillis() + 10);
View Full Code Here


            DateTime creationDate = new DateTime();
            DateTime expirationDate = new DateTime(creationDate.getMillis() + config.ttl);

            // These variables are used to build the trust assertion
            Date creationTime = creationDate.toDate();
            Date expirationTime = expirationDate.toDate();

            Conditions conditions = new ConditionsBuilder().buildObject();
            conditions.setNotBefore(creationDate);
            conditions.setNotOnOrAfter(expirationDate);
            assertion.setConditions(conditions);
View Full Code Here

            if (count < PAGE_SIZE) {
                time = time.plus(timeSlice);
                if (time.equals(day.plus(Days.ONE.toStandardDuration()))) {
                    day = day.plusDays(1);
                }
                statement = find412IndexEntries.bind(oldBucket, day.toDate(), time.toDate());
            } else {
                statement = find412IndexEntriesAfterScheduleId.bind(oldBucket, day.toDate(), time.toDate(),
                    startScheduleId);
            }
            count = 0;
View Full Code Here

                if (time.equals(day.plus(Days.ONE.toStandardDuration()))) {
                    day = day.plusDays(1);
                }
                statement = find412IndexEntries.bind(oldBucket, day.toDate(), time.toDate());
            } else {
                statement = find412IndexEntriesAfterScheduleId.bind(oldBucket, day.toDate(), time.toDate(),
                    startScheduleId);
            }
            count = 0;
            resultSet = session.execute(statement);
        } while (!time.isAfter(end));
View Full Code Here

        do {
            for (Row row : resultSet) {
                scheduleId = row.getInt(0);
                partition = (scheduleId % NUM_PARTITIONS);
                ++count;
                session.execute(updateNewIndex.bind(newBucket, partition, time.toDate(), scheduleId));
            }
            if (count < PAGE_SIZE) {
                time = time.plus(timeSlice);
                statement = find411IndexEntries.bind(oldBucket, time.toDate());
            } else {
View Full Code Here

                ++count;
                session.execute(updateNewIndex.bind(newBucket, partition, time.toDate(), scheduleId));
            }
            if (count < PAGE_SIZE) {
                time = time.plus(timeSlice);
                statement = find411IndexEntries.bind(oldBucket, time.toDate());
            } else {
                statement = find411IndexEntriesAfterScheduleId.bind(oldBucket, time.toDate(), scheduleId);
            }
            count = 0;
            resultSet = session.execute(statement);
View Full Code Here

            }
            if (count < PAGE_SIZE) {
                time = time.plus(timeSlice);
                statement = find411IndexEntries.bind(oldBucket, time.toDate());
            } else {
                statement = find411IndexEntriesAfterScheduleId.bind(oldBucket, time.toDate(), scheduleId);
            }
            count = 0;
            resultSet = session.execute(statement);
        } while (!time.isAfter(end));
    }
View Full Code Here

        while (time.isBefore(endTime)) {
            for (int i = -1; i > -numSchedules; --i) {
                List<ResultSetFuture> futures = new ArrayList<ResultSetFuture>(3);
                permits.acquire(3);
                futures.add(session.executeAsync(insert.bind(i, time.toDate(), 0, 3.14)));
                futures.add(session.executeAsync(insert.bind(i, time.toDate(), 1, 3.14)));
                futures.add(session.executeAsync(insert.bind(i, time.toDate(), 2, 3.14)));
                ListenableFuture<List<ResultSet>> insertsFuture = Futures.allAsList(futures);
                Futures.addCallback(insertsFuture, new FutureCallback<List<ResultSet>>() {
                    @Override
View Full Code Here

        while (time.isBefore(endTime)) {
            for (int i = -1; i > -numSchedules; --i) {
                List<ResultSetFuture> futures = new ArrayList<ResultSetFuture>(3);
                permits.acquire(3);
                futures.add(session.executeAsync(insert.bind(i, time.toDate(), 0, 3.14)));
                futures.add(session.executeAsync(insert.bind(i, time.toDate(), 1, 3.14)));
                futures.add(session.executeAsync(insert.bind(i, time.toDate(), 2, 3.14)));
                ListenableFuture<List<ResultSet>> insertsFuture = Futures.allAsList(futures);
                Futures.addCallback(insertsFuture, new FutureCallback<List<ResultSet>>() {
                    @Override
                    public void onSuccess(List<ResultSet> result) {
View Full Code Here

            for (int i = -1; i > -numSchedules; --i) {
                List<ResultSetFuture> futures = new ArrayList<ResultSetFuture>(3);
                permits.acquire(3);
                futures.add(session.executeAsync(insert.bind(i, time.toDate(), 0, 3.14)));
                futures.add(session.executeAsync(insert.bind(i, time.toDate(), 1, 3.14)));
                futures.add(session.executeAsync(insert.bind(i, time.toDate(), 2, 3.14)));
                ListenableFuture<List<ResultSet>> insertsFuture = Futures.allAsList(futures);
                Futures.addCallback(insertsFuture, new FutureCallback<List<ResultSet>>() {
                    @Override
                    public void onSuccess(List<ResultSet> result) {
                    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.