title: Updating Date inside a while loop, Java
body: <p>Im trying to compare the real world date with a user input date within a while loop. Although the initial execute is correct, the second time its executing the date stays the same. Ive tried asking for the date inside the while loop and now most recently from within a class method but still the date stays the same.</p>
  
  <p>How can I retrieve an up to date date?</p>
  
  <pre><code>import java.util.Date;
  
  import java.util.Scanner;
  
  class Watch {
      Date CurrentTimeAndDate = new Date();
  
      int CurrentMinutes() {
          int currentMinutes = CurrentTimeAndDate.getMinutes();
          System.out.println(currentMinutes);
          return currentMinutes;
      }
  }
  
  public class App {
  
      public static void main(String[] args) throws InterruptedException {
  
          Scanner input = new Scanner(System.in);
          String timer = null;
          int i = 0;
          int num = 0;
          Date TimeAndDate = new Date();
          int getDay = TimeAndDate.getDay();
          int getMonth = TimeAndDate.getMonth() + 1;
          int getYear = TimeAndDate.getYear() + 1900;
          int getMinutes = TimeAndDate.getMinutes();
          Watch watch1 = new Watch();
  
          String[] Month = { "", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
          String[] Day = { "", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
          System.out.println("Current time and date is    " + TimeAndDate);
          System.out.println("Printing my way! " + Day[getDay] + " " + Month[getMonth] + " " + getYear + " " + getMinutes);
          System.out.println(" Enter a short description of what you want reminding about ");
          String rem = input.nextLine();
          System.out.println(" Enter date of reminder 1-7");
          while (i &lt; 7) {
              System.out.println(i + 1 + " = " + Day[i + 1]);
              i++;
          }
          int day = input.nextInt();
  
          System.out.println("Enter Month of reminder");
          i = 0;
          while (i &lt; 12) {
              System.out.println(i + 1 + " " + "=" + " " + Month[i + 1]);
              i++;
          }
          int month = input.nextInt();
          System.out.println("Enter year");
          int year = input.nextInt();
          System.out.println("Enter Minutes, for testing purposes");
          int userInputMinutes = input.nextInt();
          System.out.println("Date set to remind you about " + rem + " " + Day[day] + " " + Month[month] + " " + year);
          if (year &gt; getYear) {
              System.out.println("Its time to remind you about ");
          } else {
              System.out.println("Waiting");
          }
          int Mins = 0;
          while (userInputMinutes != Mins) {
              Mins = watch1.CurrentMinutes();
              System.out.println("Current Minutes = " + getMinutes);
              System.out.println("Entered minutes =" + userInputMinutes);
              Thread.sleep(10000);
          }
          System.out.println("Its time to remind you about " + rem);
      }
      public static void Date(String time) {
      }
  
  }
  </code></pre>