标签:span ati mon public 现在 rgs 获取 div calendar
import java.util.Calendar; public class Calendar01 { public static void main(String[] args) { Calendar c = Calendar.getInstance(); int i = c.get(Calendar.YEAR); System.out.println(i); int i1 = c.get(Calendar.MONTH);//获取现在的年份 System.out.println(i1); c.set(Calendar.YEAR,2088);//对于年份进行设置 i = c.get(Calendar.YEAR); System.out.println(i); c.add(Calendar.YEAR,-4);//进行堆年份进行加减 i=c.get(Calendar.YEAR); System.out.println(i); } }
标签:span ati mon public 现在 rgs 获取 div calendar
原文地址:https://www.cnblogs.com/xzwx668/p/12109679.html