Java.util.Date.setTime() 方法


Java.util.Date.setTime() 方法

package com.codingdict;

import java.util.*;

public class DateDemo {
   public static void main(String[] args) {

      // create a date
      Date date = new Date(92, 1, 10);

      // set the time for 10000 milliseconds after
      // january 1, 1970 00:00:00 gmt.
      date.setTime(10000);

      // print the result
      System.out.println("Time after setting:  " + date.toString());
   }
}