眼睛周围过敏怎么办:Date类的简单应用--JSP中文网

来源:百度文库 编辑:汝南网 时间:2020/01/19 19:04:22
<%@ page contentType="text/html;charset=gb2312" import="java.util.*" %>




Document Title



<%
Date today = new Date();
int hours = today.getHours();
int minute = today.getMinutes();
if(hours>=0 && hours<12){
out.println("早上好!");
}else{
out.println("下午好!");
}
String[] weekdays = {"日","一","二","三","四","五","六"};
out.println("\n今天是" + (today.getYear()+1900) + "年" + (today.getMonth()+1) + "月" + (today.getDate()) + "日星期" + weekdays[today.getDay()]);
%>