getsystemtime.java

来自「jsp编写的B/S架构的企业人力资源管理系统」· Java 代码 · 共 22 行

JAVA
22
字号
package com.wy.tool;

import java.util.Calendar;

public class GetSystemTime {

	private Calendar now = Calendar.getInstance();
	private int year = now.get(Calendar.YEAR);
	private int month = now.get(Calendar.MONTH) + 1;
	private int day = now.get(Calendar.DAY_OF_MONTH);
	public String getToday() {
		String today = this.year + "-" + this.month + "-" + this.day;
		return today;
	}

	public String getYearMonth() {
		String today = this.year + "-" + this.month ;
		return today;
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?