⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getdate.java

📁 该系统具体分为2个部分:前台和后台。 1.前台主要用于用户进行浏览和搜索
💻 JAVA
字号:
package ynuBean;

import java.text.SimpleDateFormat;
import java.util.Date;

public class GetDate 
{
	public GetDate()
	{
	}
	public String getDateAndTime()
	{
		sdf = new SimpleDateFormat("yy/MM/dd/hh/mm");
		currentDate = new Date();
		sb= sdf.format(currentDate); 
		return sb;
	}
	public String getYearAndMonthAndDay()
	{
		sdf = new SimpleDateFormat("yy/MM/dd");
		currentDate = new Date();
		sb= sdf.format(currentDate); 
		return sb;
	}
	public String getYMD()
	{
		sdf = new SimpleDateFormat("yy/MM/dd/");
		currentDate = new Date();
		sb= sdf.format(currentDate); 
		return sb;
	}
	public String getYear()
	{
		sdf = new SimpleDateFormat("yy");
		currentDate = new Date();
		sb= sdf.format(currentDate); 
		return sb;
	}
	
	private SimpleDateFormat sdf;
	private Date currentDate;
	private String sb;
}

⌨️ 快捷键说明

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