/*   This program demonstrates the use of a procedure,
   which is just a function that doesn't return a value.
   You declare a function to not return a value by using
   the word "void" in the function's declaration.
*/

import ccj.* ;

public class PrintTime
{
  public static void main(String[] args)
  {
    Time liftoff = new Time(2000, 1, 1, 7, 0, 15);
    Time now = new Time();
    System.out.print("Liftoff: ");
    printTime(liftoff);
    System.out.print("Now: ");
    printTime(now);
   }

  //Here we declare the procedure: note
  //the use of void to indicate that there
  //is no return value.
  public static void printTime(Time t)
  {
    Console.out.printf("%4i", t.getYear());
    Console.out.printf("/%02i", t.getMonth());
    Console.out.printf("/%02i", t.getDay());
    Console.out.printf(" %02i", t.getHours());
    Console.out.printf(":%02i", t.getMinutes());
    Console.out.printf(":%02i\n", t.getSeconds());
  }
}

