當前位置:首頁 » 操作系統 » 日歷源碼

日歷源碼

發布時間: 2022-02-06 15:44:07

㈠ 求日歷的HTML代碼...

這是一段[日歷]代碼:
<span>
<iframe src='../css_test/rl.asp' width='200' height='170' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='No'></iframe>
</span>
------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無標題文檔</title>
</head>

<body>
<%
Dim currdate,currday,currfirstweek,currDayNum,gridnum,days,monthArr,I
currdate=request.QueryString("date")
If currdate="" then currdate=Date()
currfirstday=FormatdateTime(Year(currdate)&"-"&Month(currdate)&"-01")'格式當前月第一日
currfirstweek=Weekday(currfirstday)-1'獲取當前月第一日是星期幾
currDayNum=DateDiff("d",currfirstday,DateAdd("m",1,currfirstday))'獲取當前月總的天數
gridnum=currfirstweek+currDayNum'獲取格子數
If gridnum Mod 7 <>0 Then gridnum=((gridnum\7)+1)*7

monthArr=",一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月"
monthArr=split(monthArr,",")
%>

<table border="1">
<tr>
<td align="center"><a href=""><<</a></td>
<td align="center" colspan="5"><%=monthArr(Month(currdate))%> <%=Year(currdate)%></td>
<td align="center"><a href="">>></a></td>
</tr>
<tr>
<td align="center">日</td>
<td align="center">一</td>
<td align="center">二</td>
<td align="center">三</td>
<td align="center">四</td>
<td align="center">五</td>
<td align="center">六</td>
</tr>
<tr>
<%
For I=1 To gridnum
days=I-currfirstweek
If I>currfirstweek And I<=currfirstweek+currDayNum Then
If days=Day(Now()) And FormatdateTime(Now(),2)=currdate Then
Response.Write("<td align=center bgcolor=""#CCCCCC"">"& days &"</td>")
Else
Response.Write("<td align=center>"& days &"</td>")
End If
Else
Response.Write("<td align=center></td>")
End If
IF I Mod 7 = 0 Then Response.Write("</tr><tr>")
Next
%>
</tr>
</table>

</body>
</html>

㈡ ASP+JS日歷源代碼

直接保存成 asp文件 運行就可以
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="http://purl.org/dc" rel="schema.DC" />
<title>日歷</title
</head>
<body bgcolor="#FFFFFF">
<%
' 要調用的函數聲明
'根據年份及月份得到每月的總天數
Function GetDaysInMonth(iMonth, iYear)
Select Case iMonth
Case 1, 3, 5, 7, 8, 10, 12
GetDaysInMonth = 31
Case 4, 6, 9, 11
GetDaysInMonth = 30
Case 2
If IsDate("February 29, " & iYear) Then
GetDaysInMonth = 29
Else
GetDaysInMonth = 28
End If
End Select
End Function
'得到一個月開始的日期.
Function GetWeekdayMonthStartsOn(dAnyDayInTheMonth)
Dim dTemp
dTemp = DateAdd("d", -(Day(dAnyDayInTheMonth) - 1), dAnyDayInTheMonth)
GetWeekdayMonthStartsOn = WeekDay(dTemp)
End Function
'得到當前一個月的上一個月.
Function SubtractOneMonth(dDate)
SubtractOneMonth = DateAdd("m", -1, dDate)
End Function
'得到當前一個月的下一個月.
Function AddOneMonth(dDate)
AddOneMonth = DateAdd("m", 1, dDate)
End Function
' 函數聲明結束

Dim dDate ' 日歷顯示的日期
Dim iDOW ' 每一月開始的日期
Dim iCurrent ' 當前日期
Dim iPosition ' 表格中的當前位置

' 得到選擇的日期並檢查日期的合法性
If IsDate(Request.QueryString("date")) Then
dDate = CDate(Request.QueryString("date"))
Else
If IsDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year")) Then
dDate = CDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year"))
Else
dDate = Date()

If Len(Request.QueryString("month")) <> 0 Or Len(Request.QueryString("day")) <> 0 Or Len(Request.QueryString("year")) <> 0 Or Len(Request.QueryString("date")) <> 0 Then
Response.Write "您所選擇的日期格式不正確,系統會使用當前日期.<BR><BR>"
End If

End If
End If

'得到日期後我們先得到這個月的天數及這個月的起始日期.
iDIM = GetDaysInMonth(Month(dDate), Year(dDate))
iDOW = GetWeekdayMonthStartsOn(dDate)

%>
<table width="180" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="150" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="5"> </td>
</tr>
</table>
<table width="180" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" colspan="7"><table border="0" cellpadding="0" cellspacing="0"width="100%">
<tr>
<td height="22" align="right"><a href="rl.asp?date=<%= SubtractOneMonth(dDate) %>"><img src="../images/dot_left.gif" width="15" height="14" border="0" /></a></td>
<td align="center"><font color="999999"><b><%= MonthName(Month(dDate)) & " " & Year(dDate) %></b></font></td>
<td><a href="rl.asp?date=<%= AddOneMonth(dDate) %>"><img src="../images/dot_right.gif" width="15" height="14" border="0" /></a></td>
</tr>
</table></td>
</tr>
<tr>
<td width="25" height="22" align="center"><font
color="d08c00"><b>日</b></font> </td>
<td width="25" align="center"><b><font color="999999">一</font></b> </td>
<td width="25" align="center"><b><font color="999999">二</font></b> </td>
<td width="25" align="center"><b><font color="999999">三</font></b> </td>
<td width="25" align="center"><b><font color="999999">四</font></b> </td>
<td width="25" align="center"><b><font color="999999">五</font></b> </td>
<td width="25" align="center"><b><font color="d08c00">六</font></b> </td>
</tr>
<%
' 如果這個月的起始日期不是周日的話就加空的單元.
If iDOW <> 1 Then
Response.Write vbTab & "<TR>" & vbCrLf
iPosition = 1
Do While iPosition < iDOW
Response.Write vbTab & vbTab & "<TD></TD>" & vbCrLf
iPosition = iPosition + 1
Loop
End If

' 繪制這個月的日歷
iCurrent = 1
iPosition = iDOW
Do While iCurrent <= iDIM
' 如果是一行的開頭就使用 TR 標記
If iPosition = 1 Then
Response.Write vbTab & "<TR>" & vbCrLf
End If

' 如果這一天是我們選擇的日期就高亮度顯示該日期.
If iCurrent = Day(dDate) Then
Response.Write vbTab & vbTab & "<TD BGCOLOR=#eeeeee height=18 align=center><B>" & iCurrent & "</B></TD>" & vbCrLf
Else
Response.Write vbTab & vbTab & "<TD height=18 align=center><A HREF=""./rl.asp?date=" & Month(dDate) & "-" & iCurrent & "-" & Year(dDate) & """>" & iCurrent & "</A></TD>" & vbCrLf
End If

' 如果滿一周的話表格就另起一行
If iPosition = 7 Then
Response.Write vbTab & "</TR>" & vbCrLf
iPosition = 0
End If

iCurrent = iCurrent + 1
iPosition = iPosition + 1
Loop

' 如果一個月不是以周六結束則加上相應的空單元.
If iPosition <> 1 Then
Do While iPosition <= 7
Response.Write vbTab & vbTab & "<TD></TD>" & vbCrLf
iPosition = iPosition + 1
Loop
Response.Write vbTab & "</TR>" & vbCrLf
End If
%>
</table>
<table width="150" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="5"> </td>
</tr>
</table></td>
</tr>
</table>

㈢ 能不能把VB的那個日歷的源代碼發給我我急用 我只有20財富 都給你了

有什麼獎賞啊有經濟支持的話我可以考慮一下到少上網費應該有吧呵呵 呵呵,幫幫忙吧,謝謝你 以下是網頁陰歷陽歷的轉換頁面代碼 提供出來供參考-

php小白,做的日歷有源碼,求大神幫看看問題在哪裡,感激不盡

代碼邏輯就有問題

你的sql循環遍歷里截取了一次day應該是無用代碼,下面把數據存入數組中寫的鍵名 data 和前面寫的date並不一樣。你自己檢查一下有沒有問題。

另外 你的判斷日期是否特殊日期的邏輯里,是根據數組索引 $i 來判斷的,你能保證從資料庫取出的數據是按天排序每天都有的嗎?

一般做日期判斷可以把數據拉出來按日期索引 ,這樣後面日期判斷的時候根據鍵名來判斷就比較准確了。

//存入標志數組
$day_color[$row['date']]=true;

for(...){
$date=sprintf("%02d",$i);
if(!empty($day_color['2019-01-'.$date])){
...
}else{
...
}
}

㈤ 求java 日歷的小程序的源代碼

當在一段代碼塊定義一個變數時,Java就在棧中 為這個變數分配內存空間,當該變數退出該作用域後,Java會自動釋放掉為該變數所分配的內存空間,該內存空間可以立即被另作他用。

Java內存分配中的堆

堆內存用來存放由new創建的對象和數組。 在堆中分配的內存,由Java虛擬機的自動垃圾回收器來管理。

㈥ 日歷代碼, 風格顏色


別人的網站上復制代碼過來不就得咯

㈦ JS日歷代碼求助

不需要看js和css。只需要修改下面就可以了:
<inputid="selectdate"type="text"style="border:1pxsolid#999;"onClick="fPopCalendar(event,this,this)"onFocus="this.select()"/>
把上面的修改為:
<inputid="selectdate"type="text"style="border:1pxsolid#999;"onFocus="this.select()"/>
<inputtype="button"value="日期選擇"onClick="fPopCalendar(event,document.getElementById('selectdate'),document.getElementById('selectdate'))"
就是在文本框後面加一個按鈕,然後把文本框的點擊事件放到按鈕上來。
需要注意的是點擊事件onClick="fPopCalendar(event,this,this)"裡面的兩個this,第一個this你可以不修改,它只是計算位置的,我把這兩個this都換成了document.getElementById('selectdate'),單引號里是日期框的id值。這樣修改後一個頁面里每個日期輸入框的id必須是唯一的,例如兩個日期框是這樣:
<inputid="selectdate"type="text"style="border:1pxsolid#999;"onFocus="this.select()"/>
<inputtype="button"value="日期選擇"onClick="fPopCalendar(event,document.getElementById('selectdate'),document.getElementById('selectdate'))"
<inputid="selectdate2"type="text"style="border:1pxsolid#999;"onFocus="this.select()"/>
<inputtype="button"value="日期選擇"onClick="fPopCalendar(event,document.getElementById('selectdate2'),document.getElementById('selectdate2'))"
再說一句,按鈕太丑了,換個圖片多好,我們項目是這樣的

㈧ 誰有做好的百度空間的漂亮的日歷代碼

1》》》
#mod_cals .modbox——日歷模塊
#cals——日歷主體背景、邊框
#mod_cals .modbox td ——字體顏色設置
#m_cals——設置模塊背景顏色
#m_cals div——背景設置
#cals .cal_body,#cals .cal_mth——除年月控制器外的日期部分,包括周和一般日期
#cals .cal_yr table——年、月表格
#cals .cal_yr td——*年、月單元格
#cals .cal_yr .cal_pre——上一月箭頭(正常)
#cals .cal_yr .cal_nxt——下一月箭頭(正常)
#cals .cal_yr .cal_pre_ovr——上一月箭頭(滑鼠懸停)
#cals .cal_yr .cal_nxt_ovr——下一月箭頭(滑鼠懸停)

2》》》

[font=Times New Roman]把以下代碼插入最後一行即可!
#comm_info div.line{margin-top:8px;line-height:10px;border-top:2px solid #BBC1C6; background:url([/font][font=Times New Roman]http://www.hotik.com/sign.png) no-repeat bottom; padding-bottom: 100px; margin-bottom: 25px} [/font]

哪個都行!!

㈨ 求C語言編日歷源代碼的詳細說明

/*
稍微改了下對齊格式,加了注釋
*/
/*
1、閏年的演算法:
如果某年能被4整除但不能被100整除,
或者能被400整除,
則該年是閏年.
用表達式表示就是
(year
%4
==
0
&&
year%100
!=
0)
||
(year%400
==
0)
2、計算某一天是星期幾:
已知1900年的1月1號為星期一,
然後就可以用某一天和1900年的1月1號相差的天數對7取余來求星期,
本題是用的公元1年的1月1號作為基準
*/
#include
<stdio.h>
#include<conio.h>
#include<stdlib.h>
int
IsLeapYear(int);
//函數定義
void
main()
{
int
i;
int
day;
int
year;
int
temp;
int
temp_i;
long
int
Year_days
=
0;
int
Year_Start
=
1;
int
Per_Year_Days;
int
month_day[]={31,28,31,30,31,30,31,31,30,31,30,31,29};
printf("Please
enter
the
year:
");
scanf("%d",&year);
//輸入年份
while(Year_Start
<
year)
//從公元1年開始執行while循環,
該年的一月一號為星期一
{
if(
IsLeapYear(
Year_Start
)
)
Per_Year_Days
=
366;
//如果是閏年,
則一年有366天
else
Per_Year_Days
=
365;
//如果不是閏年,
則一年有365天
Year_days
=
Year_days
+
Per_Year_Days;
//Year_days為從公元1年到輸入年份的前一年的天數的總和
Year_Start++;
}
for(
temp
=
1;
temp
<=12;
temp++
)
//temp從1到12,
對應一年內12個月
{
switch(
temp
)
//用switch語句將temp和12個月對應起來
{
case
1:
printf("
January(%d)\n",year);
//一月
break;
case
2:
printf("
February(%d)\n",year);
//二月
break;
case
3:
printf("
March(%d)\n",year);
//三月
break;
case
4:
printf("
April(%d)\n",year);
//四月
break;
case
5:
printf("
May(%d)\n",year);
//五月
break;
case
6:
printf("
June(%d)\n",year);
//六月
break;
case
7:
printf("
July(%d)\n",year);
//七月
break;
case
8:
printf("
August(%d)\n",year);
//八月
break;
case
9:
printf("
September(%d)\n",year);
//九月
break;
case
10:
printf("
October(%d)\n",year);
//十月
break;
case
11:
printf("
November(%d)\n",year);
//十一月
break;
case
12:
printf("
December(%d)\n",year);
//十二月
break;
}
i
=
Year_days
%
7;
//每個星期有7天,
故用每年的天數對7取余
printf("Mon\tTue\tWed\tThu\tFri\tSat\tSun\n");
if(
i
!=
0
)
//如果余數不為零
for(
temp_i
=
0;
temp_i
<
i;
temp_i++)
printf("\t");
//則列印空格(這里用\t代替空格,
更加美觀),
空格數為i
day
=
1;
//初始化day為1,
為下面的while循環做准備
if(
IsLeapYear(year)
&&
temp
==
2)
//如果輸入的年份是閏年,
並且月份為2
while(
day
<=
month_day[12]
)
//day為一循環變數,
取值為1-365(閏年的話為1-366)
{
if(
day
>1
)
//如果天數大於一
if(
Year_days
%
7
==
0
)
//如果是星期日,
則換行
printf("\n");
if(
day
>=
10
)
printf("%d\t",day);
//列印天數+空格
else
printf("%d\t",day);
Year_days++;
day++;
}
else
//如果不滿足"輸入的年份是閏年,
並且月份為2"
while
(day
<=
month_day[temp-1])
{
if(
day
>
1
)
if(
Year_days
%
7
==
0
)
printf("\n");
if(
day
>=10
)
printf("%d\t",day);
else
printf("%d\t",day);
Year_days++;
day++;
}
printf("\n");
if(
getch()
==
'q'
)
//如果輸入為q,
則退出程序
exit(0);
}
getch();
//每按一次鍵,
列印一個月份
}
int
IsLeapYear(
int
year
)
{
//判斷是否是閏年,
是則返回1,
否則返回0
if
((year
%4
==
0)
&&
(year
%
100
!=
0)
||
(year
%
400
==
0)
)
return
1;
else
return
0;
}

㈩ 日歷表製作的源代碼

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>一個很漂亮實用的日歷</title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
//創建一個數組,用於存放每個月的天數
function montharr(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11)
{
this[0] = m0;
this[1] = m1;
this[2] = m2;
this[3] = m3;
this[4] = m4;
this[5] = m5;
this[6] = m6;
this[7] = m7;
this[8] = m8;
this[9] = m9;
this[10] = m10;
this[11] = m11;
}
//實現月歷
function calendar() {
var monthNames = "";
var today = new Date();
var thisDay;
var monthDays = new montharr(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
year = today.getYear() +1900;
thisDay = today.getDate();
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monthDays[1] = 29;
nDays = monthDays[today.getMonth()];
firstDay = today;
firstDay.setDate(1);
testMe = firstDay.getDate();
if (testMe == 2) firstDay.setDate(0);
startDay = firstDay.getDay();
document.write("<div id='rili' style='position:absolute;width:140px;left:300px;top:100px;'>")
document.write("<TABLE width='217' BORDER='0' CELLSPACING='0' CELLPADDING='2' BGCOLOR='#0080FF'>")
document.write("<TR><TD><table border='0' cellspacing='1' cellpadding='2' bgcolor='Silver'>");
document.write("<TR><th colspan='7' bgcolor='#C8E3FF'>");
var dayNames = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
var monthNames = new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
var now = new Date();
document.writeln("<FONT STYLE='font-size:9pt;Color:#330099'>" + "公元 " + now.getYear() + "年" + monthNames[now.getMonth()] + " " + now.getDate() + "日 " + dayNames[now.getDay()] + "</FONT>");
document.writeln("</TH></TR><TR><TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>日</FONT></TH>");
document.writeln("<th bgcolor='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>一</FONT></TH>");
document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>二</FONT></TH>");
document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>三</FONT></TH>");
document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>四</FONT></TH>");
document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>五</FONT></TH>");
document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>六</FONT></TH>");
document.writeln("</TR><TR>");
column = 0;
for (i=0; i<startDay; i++) {
document.writeln("\n<TD><FONT STYLE='font-size:9pt'> </FONT></TD>");
column++;
}
for (i=1; i<=nDays; i++) {
if (i == thisDay) {
document.writeln("</TD><TD ALIGN='CENTER' BGCOLOR='#FF8040'><FONT STYLE='font-size:9pt;Color:#ffffff'><B>")
}
else {
document.writeln("</TD><TD BGCOLOR='#FFFFFF' ALIGN='CENTER'><FONT STYLE='font-size:9pt;font-family:Arial;font-weight:bold;Color:#330066'>");
}
document.writeln(i);
if (i == thisDay) document.writeln("</FONT></TD>")
column++;
if (column == 7) {
document.writeln("<TR>");
column = 0;
}
}
document.writeln("<TR><TD COLSPAN='7' ALIGN='CENTER' VALIGN='TOP' BGCOLOR='#0080FF'>")
document.writeln("<FORM NAME='clock' onSubmit='0'><FONT STYLE='font-size:9pt;Color:#ffffff'>")
document.writeln("現在時間:<INPUT TYPE='Text' NAME='face' ALIGN='TOP'></FONT></FORM></TD></TR></TABLE>")
document.writeln("</TD></TR></TABLE></div>");
}
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;}
//顯示當前時間
function showtime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = " " + ((hours >12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " 下午 " : " 上午 "
document.clock.face.value = timeValue;
timerID = setTimeout("showtime()",1000);//設置超時,使時間動態顯示
timerRunning = true;}
function startclock () {
stopclock();
showtime();}
</SCRIPT>
</head>
<body onLoad="startclock(); timerONE=window.setTimeout">
<script language="JavaScript" type="text/javascript">
<!--
calendar();
//-->
</script>
</body>
</html>

熱點內容
linux下ntp伺服器搭建 發布:2024-09-08 08:26:46 瀏覽:742
db2新建資料庫 發布:2024-09-08 08:10:19 瀏覽:171
頻率計源碼 發布:2024-09-08 07:40:26 瀏覽:778
奧迪a6哪個配置帶後排加熱 發布:2024-09-08 07:06:32 瀏覽:101
linux修改apache埠 發布:2024-09-08 07:05:49 瀏覽:209
有多少個不同的密碼子 發布:2024-09-08 07:00:46 瀏覽:566
linux搭建mysql伺服器配置 發布:2024-09-08 06:50:02 瀏覽:995
加上www不能訪問 發布:2024-09-08 06:39:52 瀏覽:811
銀行支付密碼器怎麼用 發布:2024-09-08 06:39:52 瀏覽:513
蘋果手機清理瀏覽器緩存怎麼清理緩存 發布:2024-09-08 06:31:32 瀏覽:554