import java.util.Date; public class localtime { public static void main(String args[]){ Date date=new Date(); System.out.println("本地时间为:"); System.out.println(date.toString()); } }
运行如下: