Package java.util

Examples of java.util.GregorianCalendar.before()


                        System.err.println("Time " + time + " is not valid (minute " + minute + " is not between 0 and 59)");
                        return null;
                    }
                    GregorianCalendar currentDate = new GregorianCalendar();
                    GregorianCalendar shutdownDate = new GregorianCalendar(currentDate.get(Calendar.YEAR), currentDate.get(Calendar.MONTH), currentDate.get(Calendar.DAY_OF_MONTH), hour, minute);
                    if (shutdownDate.before(currentDate)) {
                        shutdownDate.set(Calendar.DATE, shutdownDate.get(Calendar.DATE) + 1);
                    }
                    sleep = shutdownDate.getTimeInMillis() - currentDate.getTimeInMillis();
                } else {
                    if (time.startsWith("+")) {
View Full Code Here


                        System.err.println("Invalid time argument.");
                        return null;
                    }
                    GregorianCalendar currentDate = new GregorianCalendar();
                    GregorianCalendar shutdownDate = new GregorianCalendar(currentDate.get(Calendar.YEAR), currentDate.get(Calendar.MONTH), currentDate.get(Calendar.DATE), Integer.parseInt(strings[0]), Integer.parseInt(strings[1]));
                    if (shutdownDate.before(currentDate)) {
                        shutdownDate.set(Calendar.DATE, shutdownDate.get(Calendar.DATE) + 1);
                    }
                    sleep = shutdownDate.getTimeInMillis() - currentDate.getTimeInMillis();
                }
            }
View Full Code Here

        gc1.setTime(d2.asDate());
        gc2.setTime(d1.asDate());
       
        // TF:20/06/2008:If we're subtracting a greater value from a lesser value, we'll end up with
        // a negative value for the value of days, but positive other values
        while (gc2.before(gc1)) {
          gc2.add(Calendar.DATE, 1);
          elapsedDays--;
        }
        while (gc1.before(gc2)) {
            gc1.add(Calendar.DATE, 1);
View Full Code Here

        gc1.setTime(d2.asDate());
        gc2.setTime(d1.asDate());
       
        // TF:20/06/2008:If we're subtracting a greater value from a lesser value, we'll end up with
        // a negative value for the value of days, but positive other values
        while (gc2.before(gc1)) {
          gc2.add(Calendar.DATE, 1);
          elapsedDays--;
        }
        while (gc1.before(gc2)) {
            gc1.add(Calendar.DATE, 1);
View Full Code Here

        gc1.setTime(d2.asDate());
        gc2.setTime(d1.asDate());
       
        // TF:20/06/2008:If we're subtracting a greater value from a lesser value, we'll end up with
        // a negative value for the value of days, but positive other values
        while (gc2.before(gc1)) {
          gc2.add(Calendar.DATE, 1);
          elapsedDays--;
        }
        while (gc1.before(gc2)) {
            gc1.add(Calendar.DATE, 1);
View Full Code Here

        gc1.setTime(d2.asDate());
        gc2.setTime(d1.asDate());
       
        // TF:20/06/2008:If we're subtracting a greater value from a lesser value, we'll end up with
        // a negative value for the value of days, but positive other values
        while (gc2.before(gc1)) {
          gc2.add(Calendar.DATE, 1);
          elapsedDays--;
        }
        while (gc1.before(gc2)) {
            gc1.add(Calendar.DATE, 1);
View Full Code Here

                        if ( !stringDueDate.equals( "" ) ) {
                            GregorianCalendar gregoriancalendarDueDate =
                                this.getGregorianCalendarFromString( stringDueDate );
                           
                            // Testing if the due date is before the calculated end date
                            if ( gregoriancalendarDueDate.before( gregoriancalendarEndDate ) ) {
                                /* Getting the date when the processing of the feature/bug should
                                   be started at the latest */
                                GregorianCalendar gregoriancalendarLatestDateToStart =
                                    this.getWorkday( gregoriancalendarDueDate,
                                                     -( intNeededDays - 1 ),
View Full Code Here

                            GregorianCalendar gregCalDueDate =
                                this.getGregorianCalendarFromString(sDueDate);
                           
                            // Testing if the due date is before the calculated
                            // end date
                            if ( gregCalDueDate.before(
                                     gregCalEndDate ) ) {
                                /* Getting the date when the processing of the
                                   feature/bug should
                                   be started at the latest */
                                GregorianCalendar gregCalLatestDateToStart =
View Full Code Here

                    if (strings.length != 2) {
                        throw new IllegalArgumentException("Time " + time + " is not valid");
                    }
                    GregorianCalendar currentDate = new GregorianCalendar();
                    GregorianCalendar shutdownDate = new GregorianCalendar(currentDate.get(Calendar.YEAR), currentDate.get(Calendar.MONTH), currentDate.get(Calendar.DATE), Integer.parseInt(strings[0]), Integer.parseInt(strings[1]));
                    if (shutdownDate.before(currentDate)) {
                        shutdownDate.set(Calendar.DATE, shutdownDate.get(Calendar.DATE) + 1);
                    }
                    sleep = shutdownDate.getTimeInMillis() - currentDate.getTimeInMillis();
                }
            }
View Full Code Here

                        System.err.println("Invalid time argument.");
                        return null;
                    }
                    GregorianCalendar currentDate = new GregorianCalendar();
                    GregorianCalendar shutdownDate = new GregorianCalendar(currentDate.get(Calendar.YEAR), currentDate.get(Calendar.MONTH), currentDate.get(Calendar.DATE), Integer.parseInt(strings[0]), Integer.parseInt(strings[1]));
                    if (shutdownDate.before(currentDate)) {
                        shutdownDate.set(Calendar.DATE, shutdownDate.get(Calendar.DATE) + 1);
                    }
                    sleep = shutdownDate.getTimeInMillis() - currentDate.getTimeInMillis();
                }
            }
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.