forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshowTime.jsp
More file actions
23 lines (20 loc) · 770 Bytes
/
showTime.jsp
File metadata and controls
23 lines (20 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<%@ page language="java" contentType="text/html; charset=gb2312"%>
<%@ page import="java.util.Date" %>
<%
//获取输出在菜单栏中的时间
String[] weekdays={"","日","一","二","三","四","五","六"};
String[] days=new String[42];
for(int i=0;i<42;i++)
days[i]="";
Date currentDay = new Date();
int year=1900+currentDay.getYear();
int month=currentDay.getMonth();
int today=currentDay.getDate();
int weekday=currentDay.getDay()+1;
String now=year+"年"+(month+1)+"月"+today+"日"+" 星期"+weekdays[weekday];
%>
<script type="text/javascript" src="js/showTime.js"></script>
<body onload="showTime(time)">
<%=now %>
<input type="text" style="border:0;background-color:white" disabled id="time" size="9">
</body>