Date: setTime(long miliseconds) : Date « java.util « Java by API






Date: setTime(long miliseconds)

/*
 * Output:
Thu Aug 03 13:27:11 PDT 2006
 */

import java.util.*;

public class MainClass {

  public static void main(String args[]) {

    Date date = new Date();

    long msec = date.getTime();

    msec += 100 * 24 * 60 * 60 * 1000L;

    date.setTime(msec);

    System.out.println(date);
  }
}

           
       








Related examples in the same category

1.new Date()
2.new Date(int intValue)
3.Date: after(Date when)
4.Date: before(Date when)
5.Date: diff (Not a method)
6.Date: equals(Object anotherDate)
7.Date: getTime()