Examples of hourOfDay()


Examples of com.webobjects.foundation.NSTimestamp.hourOfDay()

        TimeZone currentTimeZone = currentTime.timeZone();
        int currentYear = currentTime.yearOfCommonEra();
        int currentMonth = currentTime.monthOfYear();
        int currentDayOfMonth = currentTime.dayOfMonth()// [1,31]
        int currentHourOfDay = currentTime.hourOfDay();    // [0,23]

        return new NSTimestamp(currentYear, currentMonth, currentDayOfMonth, currentHourOfDay+1, 0, 0, currentTimeZone);
    }

    /********** Unregistered Applications **********/
 
View Full Code Here

Examples of com.webobjects.foundation.NSTimestamp.hourOfDay()

        NSTimestamp currentTime = new NSTimestamp(System.currentTimeMillis(), java.util.TimeZone.getDefault());
        TimeZone currentTimeZone = currentTime.timeZone();
        int currentYear = currentTime.yearOfCommonEra();
        int currentMonth = currentTime.monthOfYear();
        int currentDayOfMonth = currentTime.dayOfMonth(); // [1,31]
        int currentHourOfDay = currentTime.hourOfDay(); // [0,23]

        // Java normally returns 1-7, ObjC returned 0-6, JavaFoundation will
        // return 0-6
        int currentDayOfWeek = currentTime.dayOfWeek(); // [0,6] ==
        // [Sunday,Saturday]
View Full Code Here

Examples of org.elasticsearch.common.joda.time.MutableDateTime.hourOfDay()

        long TIME = utcTimeInMillis("2009-02-03T01:01:01");
        MutableDateTime time = new MutableDateTime(DateTimeZone.UTC);
        time.setMillis(TIME);
        assertThat(time.monthOfYear().roundFloor().toString(), equalTo("2009-02-01T00:00:00.000Z"));
        time.setMillis(TIME);
        assertThat(time.hourOfDay().roundFloor().toString(), equalTo("2009-02-03T01:00:00.000Z"));
        time.setMillis(TIME);
        assertThat(time.dayOfMonth().roundFloor().toString(), equalTo("2009-02-03T00:00:00.000Z"));
    }

    @Test public void testRoundingSetOnTime() {
View Full Code Here

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

                    String minute = matcher.group(2);
                    String day = matcher.group(3);

                    LocalDateTime dateTime = new LocalDateTime(2018, 1, Integer.parseInt(day), Integer.parseInt(hour), Integer.parseInt(minute));
                    DateTime converted = convertJodaTimezone(dateTime, fromTimeZone, toTimeZone);
                    return String.format("%02d:%02d-%s", converted.hourOfDay().get(), converted.minuteOfHour().get(), converted.dayOfWeek().get());
                }
                return null;
            }
        });
    }
View Full Code Here

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

        return DateTimeComparator.getInstance().compare(currentHour(), endTime) >= 0;
    }

    public DateTime hour0() {
        DateTime rightNow = now();
        return rightNow.hourOfDay().roundFloorCopy().minusHours(
            rightNow.hourOfDay().roundFloorCopy().hourOfDay().get());
    }

}
View Full Code Here

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

    }

    public DateTime hour0() {
        DateTime rightNow = now();
        return rightNow.hourOfDay().roundFloorCopy().minusHours(
            rightNow.hourOfDay().roundFloorCopy().hourOfDay().get());
    }

}
View Full Code Here

Examples of org.joda.time.MutableDateTime.hourOfDay()

                        break;
                    case 'h':
                    case 'H':
                        if (type == 0) {
                            if (roundUp) {
                                dateTime.hourOfDay().roundCeiling();
                            } else {
                                dateTime.hourOfDay().roundFloor();
                            }
                        } else if (type == 1) {
                            dateTime.addHours(num);
View Full Code Here

Examples of org.joda.time.MutableDateTime.hourOfDay()

                    case 'H':
                        if (type == 0) {
                            if (roundUp) {
                                dateTime.hourOfDay().roundCeiling();
                            } else {
                                dateTime.hourOfDay().roundFloor();
                            }
                        } else if (type == 1) {
                            dateTime.addHours(num);
                        } else if (type == 2) {
                            dateTime.addHours(-num);
View Full Code Here

Examples of org.joda.time.MutableDateTime.hourOfDay()

        long TIME = utcTimeInMillis("2009-02-03T01:01:01");
        MutableDateTime time = new MutableDateTime(DateTimeZone.UTC);
        time.setMillis(TIME);
        assertThat(time.monthOfYear().roundFloor().toString(), equalTo("2009-02-01T00:00:00.000Z"));
        time.setMillis(TIME);
        assertThat(time.hourOfDay().roundFloor().toString(), equalTo("2009-02-03T01:00:00.000Z"));
        time.setMillis(TIME);
        assertThat(time.dayOfMonth().roundFloor().toString(), equalTo("2009-02-03T00:00:00.000Z"));
    }

    @Test
View Full Code Here

Examples of org.joda.time.MutableDateTime.hourOfDay()

        DateMidnight start = end.minus(Months.months(MONTHS_TO_GO_BACK));
        List<Activity> activities = new ArrayList<Activity>();
        MutableDateTime mdt = new MutableDateTime(start, timeZone);
        while (mdt.isBefore(end))
        {
            mdt.hourOfDay().set(9);
            int activitiesCount = 1 + random.nextInt(ACTIVITIES_PER_DAY);
            int hours = 2 + random.nextInt(6) / activitiesCount;
            for (int j = 0; j < activitiesCount; j++)
            {
                Activity activity = new Activity(loremIpsum.randomWords(2), loremIpsum.randomWords(4), timeZone);
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.