<html locale="true">
<head>
<title><bean:message key="hrUsers.maint" /></title>
<script language="javascript">
var textId;
var text;
function calendarDefalut(name) //定义dateSelector的display方法,它将实现一个日历形式的日期选择框。
{
var myDate=new Date();
this.year=myDate.getFullYear(); //定义year属性,年份,默认值为当前系统年份。
this.month=myDate.getMonth()+1; //定义month属性,月份,默认值为当前系统月份。
calendar('default',name,this.year+'/'+this.month);
}
function calendar(id,name,value) //定义dateSelector的display方法,它将实现一个日历形式的日期选择框。
{
textId = id;
document.write("<style type=text/css>");
document.write(" .ds_font td,span { font: normal 12px 宋体; color: #000000; }");
document.write(" .ds_border { border: 1px solid #000000; cursor: hand; background-color: #F7F7F7 }");
document.write(" .ds_border2 { border: 1px solid #000000; cursor: hand; background-color: #F7F7F7 }");
document.write("</style>");
document.write(" <span width=12% onmouseover=this.className='ds_border' onmouseout=this.className='' onclick=subYear() title='减小年份'><< </span>");
document.write(" <span width=12% onmouseover=this.className='ds_border' onmouseout=this.className='' onclick=subMonth() title='减小月份'><</span>");
document.write(" <span width=52%><input id='"+id+"' type='text' name='"+name+"' value="+value+" readonly='readonly' size='3' style='border-style: solid; border-color: #FFFFFF;border: 0px solid #000000; background-color: #F7F7F7'></span>");
document.write(" <span width=12% onmouseover=this.className='ds_border' onmouseout=this.className='' onclick=addMonth() title='增加月份'>> </span>");
document.write(" <span width=12% onmouseover=this.className='ds_border' onmouseout=this.className='' onclick=addYear() title='增加年份'>>></span>");
text= document.getElementById(textId);
}
function subYear() //减小年份
{
var value = text.value;
text.value = (eval(value.substr(0,4))-1)+'/'+value.substr(5,2);
}
function addYear() //增加年份
{
var value = text.value;
text.value = (eval(value.substr(0,4))+1)+'/'+value.substr(5,2);
}
function subMonth() //减小月份
{
var value = text.value;
var month=eval(value.substr(5,2))-1;
var year = value.substr(0,4)
if(month==0)
{
month=12;
year = eval(year)-1;
}
text.value = year+'/'+month;
}
function addMonth() //增加月份
{
var value = text.value;
var month=eval(value.substr(5,2))+1;
var year = value.substr(0,4)
if(month==13)
{
month=1;
year = eval(year)+1;
}
text.value = eval(year)+'/'+month;
}
</script>
</HEAD>
ssss:<script language=javascript>calendarDefalut('hrUsers.userNo');</script>
</html>
分享到:
相关推荐
select month('2007-10-11') select day(getdate())as '今天' select dateadd(day,100,getdate()) /*select datediff(day,'1988-08-29',getdate()) select datediff(month,'1988-08-29',getdate()) select datediff...
2.SELECT MONTH('11/15/1981') 3.SELECT YEAR('04/04/1982') 4.SELECT GETDATE() 5.SELECT DATEADD(day, 21,'1991-07-10 2:30:00.000') 6.SELECT DATEDIFF(day, '02/20/1999', '02/28/1999') 7.SELECT DATENAME(day,...
示例:SELECT MONTH('1998-02-03'); -> 2 7. DAYNAME() 函数 DAYNAME() 函数返回日期或日期时间表达式的星期名。 示例:SELECT DAYNAME("1998-02-05"); -> 'Thursday' 8. MONTHNAME() 函数 MONTHNAME() 函数...
mysql> SELECT something FROM table WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) ; DAYOFWEEK(date) 返回日期date的星期索引(1=星期天,2=星期一, ……7=... mysql> select MONTH('1998-02-03'); -> 2
mysql> SELECT MONTH('1998-02-03'); 返回 2,表示该日期是 2 月。 6. DAYNAME 函数 DAYNAME 函数用于返回日期的星期名字,例如: mysql> SELECT DAYNAME('1998-02-05'); 返回 'Thursday',表示该日期是星期四...
SELECT DateName(month, '2023-01-01'); -- 返回2023年1月1日的月份 ``` ##### 2. DATEPART (datepart, date) - **功能**:此函数返回表示指定日期的指定日期部分的整数。 - **语法**:`DATEPART (datepart, date...
SELECT MONTHNAME(NOW()); ``` - **DAYNAME(date)**: 返回星期的英文名称。 ```sql SELECT DAYNAME(NOW()); ``` - **WEEK(date, mode)**: 返回日期所在的周数,mode参数可以设置为0(表示从周一算起)或1...
SELECT DATEPART(MONTH, '2004-10-15') * 提取日期的日: SELECT DATEPART(DAY, '2004-10-15') 五、日期格式转换 Sql Server 提供了 CONVERT 函数来转换日期格式,例如: * 将日期转换为字符串格式: SELECT ...
SELECT EXTRACT(MONTH FROM @dt); -- 9 SELECT EXTRACT(WEEK FROM @dt); -- 36 SELECT EXTRACT(DAY FROM @dt); -- 10 SELECT EXTRACT(HOUR FROM @dt); -- 7 SELECT EXTRACT(MINUTE FROM @dt); -- 15 SELECT EXTRACT...
select *, (select count(*) from student where cid = classes.id) as num from classes order by num; # in, not in子句查询示例 查询班级id大于小于的这些班级的学生信息 select * from student where cid ...
示例:`SELECT MONTH(GETDATE()) AS CurMonth` 5. 获取当前年份 `YEAR` 函数用于获取当前的年份。 示例:`SELECT YEAR(GETDATE()) AS CurYear` 6. 获取当前日期的 Day `DAY` 函数用于获取当前日期的 Day。 ...
mysql> select MONTH('1998-02-03'); -> 2 ``` DAYNAME(date) `DAYNAME` 函数返回日期 `date` 是星期几,以英文名返回。 示例: ```sql mysql> select DAYNAME("1998-02-05"); -> 'Thursday' ``` MONTHNAME(date) ...
SELECT MONTHNAME(CURRENT_DATE) FROM SYSIBM.SYSDUMMY1; ``` - **DayName**: 返回给定日期是一周中的哪一天。 - **DB2**: ```sql SELECT DAYNAME(CURRENT_DATE) FROM SYSIBM.SYSDUMMY1; ``` #### 三、字符...
- 示例:`SELECT MONTHNAME("1998-02-05");` - 结果:February - **`QUARTER(date)`:**返回给定日期所在季度的数字表示。 - 示例:`SELECT QUARTER('98-04-01');` - 结果:2 - **`WEEK(date)`:**返回给定...
SELECT monthname(now()); ``` 11. `date_format(date, format)`:根据指定的格式来格式化日期。例如: ```sql SELECT date_format(now(),'%M,%D,%Y'); ``` 日期添加和减去函数如`date_add()`和`date_sub()`...
SELECT YEAR(order_date) AS Year, MONTH(order_date) AS Month, SUM(order_total) AS TotalSales FROM orders JOIN products ON orders.product_id = products.product_id WHERE order_date BETWEEN '2022-01-01' ...