Package java.util

Examples of java.util.Calendar.clear()


     * @return a string on the format HH:MM:SS representing the time
     * @see org.apache.derby.client.am.DateTime#timeBytesToTime
     */
    private String formatTime(Time time) {
        Calendar cal = getGMTCalendar();
        cal.clear();
        cal.setTime(time);

        char[] buf = "HH:MM:SS".toCharArray();
        padInt(buf, 0, 2, cal.get(Calendar.HOUR_OF_DAY));
        padInt(buf, 3, 2, cal.get(Calendar.MINUTE));
View Full Code Here


     * @return a string on the format YYYY-MM-DD-HH.MM.SS.ffffff[fff]
     * @see org.apache.derby.client.am.DateTime#timestampBytesToTimestamp
     */
    private String formatTimestamp(Timestamp ts) {
        Calendar cal = getGMTCalendar();
        cal.clear();
        cal.setTime(ts);

        char[] buf = new char[appRequester.getTimestampLength()];
        padInt(buf, 0, 4, cal.get(Calendar.YEAR));
        buf[4] = '-';
View Full Code Here

     * @return a string on the format YYYY-MM-DD representing the date
     * @see org.apache.derby.client.am.DateTime#dateBytesToDate
     */
    private String formatDate(java.sql.Date date) {
        Calendar cal = getGMTCalendar();
        cal.clear();
        cal.setTime(date);

        char[] buf = "YYYY-MM-DD".toCharArray();
        padInt(buf, 0, 4, cal.get(Calendar.YEAR));
        padInt(buf, 5, 2, cal.get(Calendar.MONTH) + 1);
View Full Code Here

                    // Get date time.
                    Calendar calendar = Calendar.getInstance();
                    calendar.setTime(new SimpleDateFormat(
                            "dd/MMM/yyyy:HH:mm:ss").parse(dateTime));
                    // remove time so we can filter by date later.
                    calendar.clear(Calendar.MILLISECOND);
                    calendar.clear(Calendar.MINUTE);
                    calendar.clear(Calendar.SECOND);
                    // Weird java bug. calling calendar.clear(Calendar.HOUR)
                    // does not clear the hour but this works.
                    calendar.clear(calendar.HOUR_OF_DAY);
View Full Code Here

                    Calendar calendar = Calendar.getInstance();
                    calendar.setTime(new SimpleDateFormat(
                            "dd/MMM/yyyy:HH:mm:ss").parse(dateTime));
                    // remove time so we can filter by date later.
                    calendar.clear(Calendar.MILLISECOND);
                    calendar.clear(Calendar.MINUTE);
                    calendar.clear(Calendar.SECOND);
                    // Weird java bug. calling calendar.clear(Calendar.HOUR)
                    // does not clear the hour but this works.
                    calendar.clear(calendar.HOUR_OF_DAY);
                    calendar.clear(calendar.HOUR);
View Full Code Here

                    calendar.setTime(new SimpleDateFormat(
                            "dd/MMM/yyyy:HH:mm:ss").parse(dateTime));
                    // remove time so we can filter by date later.
                    calendar.clear(Calendar.MILLISECOND);
                    calendar.clear(Calendar.MINUTE);
                    calendar.clear(Calendar.SECOND);
                    // Weird java bug. calling calendar.clear(Calendar.HOUR)
                    // does not clear the hour but this works.
                    calendar.clear(calendar.HOUR_OF_DAY);
                    calendar.clear(calendar.HOUR);
                    ArrayList msgs;
View Full Code Here

                    calendar.clear(Calendar.MILLISECOND);
                    calendar.clear(Calendar.MINUTE);
                    calendar.clear(Calendar.SECOND);
                    // Weird java bug. calling calendar.clear(Calendar.HOUR)
                    // does not clear the hour but this works.
                    calendar.clear(calendar.HOUR_OF_DAY);
                    calendar.clear(calendar.HOUR);
                    ArrayList msgs;
                    if (logs.containsKey(calendar.getTime())) {
                        msgs = (ArrayList) logs.get(calendar.getTime());
                    } else {
View Full Code Here

                    calendar.clear(Calendar.MINUTE);
                    calendar.clear(Calendar.SECOND);
                    // Weird java bug. calling calendar.clear(Calendar.HOUR)
                    // does not clear the hour but this works.
                    calendar.clear(calendar.HOUR_OF_DAY);
                    calendar.clear(calendar.HOUR);
                    ArrayList msgs;
                    if (logs.containsKey(calendar.getTime())) {
                        msgs = (ArrayList) logs.get(calendar.getTime());
                    } else {
                        msgs = new ArrayList();
View Full Code Here

                        || endDate == null || endMonth == null || endYear == null) {
                    // just keep the month date and year
                    cal1.set(Calendar.MILLISECOND, 0);
                    cal1.set(Calendar.MINUTE, 0);
                    cal1.set(Calendar.SECOND, 0);
                    cal1.clear(Calendar.HOUR_OF_DAY);
                    cal2.setTime(cal1.getTime());
                    cal2.add(Calendar.DAY_OF_YEAR, 1);

                    WebAccessLog.SearchResults matchingItems = log.getMatchingItems(log.getLogFileNames()[0], //todo: handle multiple
                                                null, null, null, null, cal1.getTime(), cal2.getTime(), null, null);
View Full Code Here

                    String requestHost = (String) renderRequest.getParameter("requestHost");
                    String authUser = (String) renderRequest.getParameter("authUser");
                    String requestMethod = (String) renderRequest.getParameter("requestMethod");
                    String requestedURI = (String) renderRequest.getParameter("requestedURI");
                    if (ignoreDates) {
                        cal1.clear();
                        cal2.clear();
                        cal1.set(Calendar.DATE, sdt);
                        cal1.set(Calendar.MONTH, smnth);
                        cal1.set(Calendar.YEAR, syr);
                        cal2.set(Calendar.DATE, edt);
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.