package com.chongrui.test;/*运用SWITCH语句打印星期几的单词 * */ public class TypeConvertion { public static void main(String[] args){ System.out.println("今天星期几"); int week = 6; switch(week){ case 1: //case后面要常量 System.out.println("Monday"); break
var arys1 = new Array(); arys1 = "2016-09-25".split('-'); //日期为输入日期,格式为 2013-3-10 var ssdate = new Date(arys1[0], parseInt(arys1[1] - 1), arys1[2]); var week1=String(ssdate.getDay()).replace("0","日").replace("1",&qu
--建立函数计算星期 create function w_count( ) --月份 ,))--星期几 returns int as begin ' as datetime) ,,')) as datetime) while(@b <= @e) begin if(DATENAME(DW,@b) = @dw) begin end ,@b) end return(@count_day) end go --测试 ','星期六')
<script> var CalendarData=new Array(20); var madd=new Array(12); var TheDate=new Date(); var numString="一二三四五六七八九十"; var monString="正二三四五六七八九十冬腊"; var weekString="日一二三四五六"; var cYear; var cMonth; var cDay; var cHour; va
--根据日期查询星期SELECT SYSDATETIME();select datepart(weekday,getdate()); SET DATEFIRST 1select '星期'+case when cast(datepart(dw,getdate()) as char(1))= 7 then '天' else cast(datepart(dw,getdate()) as char(1)) end select @@datefirst; datefirst 一般美国采用星期天作为一周的第
js代码: <script type="text/javascript"> var today = new Date(); var week; //存储星期几 var date; //存储日期 switch (today.getDay()) { case 0: week = "星期日"; break; case 1: week = "星期一"; break; case 2: week = "星期三"; break;
JS获取日期时遇到如下需求,根据某年某周获取一周的日期.如开始日期规定为星期四到下一周的星期五为一周. 格式化日期: function getNowFormatDate(theDate) { var day = theDate; var Year = 0; var Month = 0; var Day = 0; var CurrentDate = ""; // 初始化时间 Year= day.getFullYear();// ie火狐下都可以 Month= day.getMonth()
获取当前阳历日期时间,阴历日期和星期,三者分开,可自行调整顺序. 新建JS文件getdates.js,代码如下:/*获取当前阳历日期*/function getCurrentDateTime() { var d = new Date(); var year = d.getFullYear(); var month = d.getMonth() + 1; var date = d.getDate(); /*时分秒*//**********************var hours = d.get
//设置节假日的数组 var holiday = Array('2016-04-30','2016-05-01','2016-05-02','2016-06-09','2016-06-10','2016-06-11','2016-09-15','2016-09-16','2016-09-17','2016-10-1','2016-10-01','2016-10-02','2016-10-03','2016-10-04','2016-10-05','2016-10-06','201