package com.itcast;
import java.text.*;
import java.util.*;
public class RuntimeDemo {
public static void main(String[]args)
{
/* Date d=new Date();
SimpleDateFormat sdf=new SimpleDateFormat("yyyy年MM月DD日 E hh:mm:ss");
System.out.println(d);
String time=sdf.format(d);
System.out.println(time);
long l=System.currentTimeMillis();
Date dl=new Date(l);
System.out.println(dl);*/
/* Date d=new Date();
SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
String time=sdf.format(d);
System.out.println(time);*/
Calendar c=Calendar.getInstance();
//System.out.println(c);
sop(c.get(Calendar.YEAR)+"年"+c.get((Calendar.MONTH)+1)此处加1为九月不加为一月我的系统时间没错啊?怎么和我系统时间不一样啊+"月"+c.get(Calendar.DAY_OF_MONTH));
}
public static void sop(Object obj)
{
System.out.println(obj);
}
} |
|