有没有软件是可以显示今天是这今天是一年的第几天周的?周历?比如WEEK25是几号到几号的

这周的天气怎样?英语怎么说1 这周的 / 这几天的,天气怎样?2 这周的天气 都不错 / 都很差3 这周是本月的第几周?这周是 本月 第二周.4 今天是 这周的第几天?/今天是 这周的 第五天了.5 这个月是全年的第几个月?/ 这个月是一年中的第四个月.英语翻译.
kbFM79XJ35
1.What's the weather like in this week2.This week the weather is pretty good/all is very poor3.This week is the first week of this monthThis week is the second week of the month4.Which day of this week is it today?
today is the fifth day of the week5.Is which months of the year this month? this month is the fourth month of the year.
为您推荐:
其他类似问题
扫描下载二维码c# 里面如何获取当前周?就是如何获取当前的日期是处于这一年的第几周_百度知道
c# 里面如何获取当前周?就是如何获取当前的日期是处于这一年的第几周
就是如何获取当前的日期是处于这一年的第几周
提问者采纳
+ & 取指定日期是一年中的第几周 // DayOfWeek firstweek =&#47.Y/ & /dtime&quot.DayOfY i = i + 7) { weeknum = weeknum + 1;//&#47.ToString() + &);/summary& DateTime tmpdate = DateT &/param&returns& } return weeknum.Parse(param name=&/给定的日期& /-1& i &= //&数字 一年中的第几周&lt//returns&if(firstweek) for (int i = (int)firstweek + 1; public static int weekofyear(DateTime dtime) { int weeknum = 0;-1&quot.DayOfW &/ /summary&// &lt
其他类似问题
为您推荐:
其他4条回答
先获得本日是本年的第几天:本年的第一天是第一个星期,然后除以7,得到的数加1就是第几周了c#中没有这样的方法,你只能自己写。原理
SQL 语句可以做到
(DateTime.Today.DayOfYear + 1) / 7
DayOfYear / 7 可以吗?
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁哪位高手能给提供一个年周算法,输入的日期,然后获得日期是这一年的第几周啊_百度知道
哪位高手能给提供一个年周算法,输入的日期,然后获得日期是这一年的第几周啊
我有更好的答案
text中输入格式为,点击Button1即弹出消息框提示结果;在窗体中加入Edit1和Button1:Application:,0),Edit1用来输入日期.Text)))),比如,&#39,Button1用来显示结果:yyyy-mm-dd的日期。在Button1的单击事件下输入代码,在Edit1.Messagebox(pchar(IntToStr(WeekOfTheYear(strtodatetime(Edit1;当前日期在一年当中的第几周;运行后在uses中引用DateUtils
有函数//需要引用单元DateUtils WeekOfTheYear
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁计算当前天是第几周的算法以及小技巧
public static int getWeekOfYear(String
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
//这一句必须要设置,否则美国认为第一天是周日,而我国认为是周一,对计算当期日期是第几周会有错误
cal.setFirstDayOfWeek(Calendar.MONDAY); //
设置每周的第一天为星期一
cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);//
每周从周一开始
cal.setMinimalDaysInFirstWeek(1);
设置每周最少为1天
cal.setTime(df.parse(date));
return cal.get(Calendar.WEEK_OF_YEAR);
catch(Exception e){
e.printStackTrace();
示例代码:
WeekCalendar.java
---------------------------------------------------
import java.text.ParseE
import java.text.SimpleDateF
import java.util.ArrayL
import java.util.C
import java.util.D
import java.util.L
public class WeekCalendar{
&public static String weekdatetodata(int year, int
month, int weekOfMonth, int dayOfWeek){
&&Calendar c =
Calendar.getInstance();
&&//计算出 x年 y月 1号 是星期几
&&c.set(year, month - 1, 1);
&&//如果i_week_day =1
的话实际上是周日&
&&int i_week_day =
c.get(Calendar.DAY_OF_WEEK);
&&int sumDay = 0;
&&//dayOfWeek+1 就是星期几(星期日 为
&&if(i_week_day == 1){
&&&sumDay =
(weekOfMonth - 1) * 7 + dayOfWeek + 1;
&&&sumDay = 7 -
i_week_day + 1 + (weekOfMonth - 1) * 7 + dayOfWeek + 1;
&&//在1号的基础上加上相应的天数
&&c.set(Calendar.DATE,
&&SimpleDateFormat sf2 = new
SimpleDateFormat("yyyy-MM-dd");
sf2.format(c.getTime());
&public static int getWeekOfYear(String date){
&&&SimpleDateFormat
df = new SimpleDateFormat("yyyy-MM-dd");
&&&Calendar cal
= Calendar.getInstance();
&&&//这一句必须要设置,否则美国认为第一天是周日,而我国认为是周一,对计算当期日期是第几周会有错误
&&&cal.setFirstDayOfWeek(Calendar.MONDAY);
// 设置每周的第一天为星期一
&&&cal.set(Calendar.DAY_OF_WEEK,
Calendar.MONDAY);// 每周从周一开始
&&&cal.setMinimalDaysInFirstWeek(1);
// 设置每周最少为1天
&&&cal.setTime(df.parse(date));
cal.get(Calendar.WEEK_OF_YEAR);
&&catch(Exception e){
&&&e.printStackTrace();
&&return 0;
&public static int getWeekOfYear(Date date){
&&&Calendar cal
= Calendar.getInstance();
&&&cal.setFirstDayOfWeek(Calendar.MONDAY);
// 设置每周的第一天为星期一
&&&cal.set(Calendar.DAY_OF_WEEK,
Calendar.MONDAY);// 每周从周一开始
&&&cal.setMinimalDaysInFirstWeek(1);
// 设置每周最少为1天
&&&cal.setTime(date);
cal.get(Calendar.WEEK_OF_YEAR);
&&catch(Exception e){
&&&e.printStackTrace();
&&return 0;
&public static Calendar CalendarSetTime(String
sCurrDate){
&&Calendar oCalendar =
Calendar.getInstance();
&&Date oDate = new Date();
&&SimpleDateFormat sdf = new
SimpleDateFormat("yyyy-MM-dd");
&&if(!sCurrDate.equals("")
&& sCurrDate != null){
&&&&oCalendar.setTime(sdf.parse(sCurrDate));
&&&catch(Exception
&&&&ex.printStackTrace(System.err);
&&&&System.out.println("日期格式转换错误:="
+ sCurrDate);
&&&oCalendar.setTime(oDate);
&&return oC
&public static List Calendar(String
sCurrDate){
&&String[] oneWeekDay = {"星期日",
"星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
&&Calendar oCal =
&&String LoopDate = "";
&&int iweek = 0, iCurrWeek =
CalendarSetTime(sCurrDate);//设置时间
oCal.get(Calendar.DAY_OF_WEEK) - 1;
&&String DataSet[] =
&&ArrayList&String[]&
DayAndWeek = new ArrayList();
&&for(int i = i
& 0; i--){
&&&oCal.add(Calendar.DATE,
&&&LoopDate =
oCal.get(Calendar.YEAR) + "-" + (oCal.get(Calendar.MONTH) + 1) +
"-" + oCal.get(Calendar.DATE);
CalendarSetTime(sCurrDate);//重置时间
&&&DataSet = new
String[2];
&&&DataSet[0] =
&&&DataSet[1] =
oneWeekDay[(iCurrWeek++)];
&&&DayAndWeek.add(DataSet);
&&for(int i = 0; i
& 7 - i++){
&&&oCal.add(Calendar.DATE,
&&&LoopDate =
oCal.get(Calendar.YEAR) + "-" + (oCal.get(Calendar.MONTH) + 1) +
"-" + oCal.get(Calendar.DATE);
CalendarSetTime(sCurrDate);
&&&DataSet = new
String[2];
&&&DataSet[0] =
&&&DataSet[1] =
oneWeekDay[(iCurrWeek++)];
&&&DayAndWeek.add(DataSet);
&&return DayAndW
&public static void main(String[] args) throws
ParseException{
&&//2009年1月
第二周星期三得到
&&//&&System.out.println(weekdatetodata(2009,
1, 2, 3));
&&//2009年2月
第二周星期三得到
&&//&&System.out.println(weekdatetodata(2009,
2, 2, 3));
&&//2009年4月
第二周星期三得到
&&//&&System.out.println(weekdatetodata(2009,
4, 2, 3));
&&//2009年2月
第三周星期四得到
&&//&&System.out.println(weekdatetodata(2009,
2, 3, 4));
&&//&&System.out.println("第几周:"+getWeekOfYear(""));
&&//&&System.out.println("第几周:"+getWeekOfYear(""));
&&//&&System.out.println("第几周:"+getWeekOfYear(""));
&&//&&System.out.println("第几周:"+getWeekOfYear(""));
&&DateObj d = getDateObj(new
Date(System.currentTimeMillis()));
&&System.out.println(d);
&public static DateObj getDateObj(Date
&&DateObj obj = new
DateObj();
&&if(null != mydate){
&&&SimpleDateFormat
sformat = new SimpleDateFormat("yyyy-MM-dd");
dateString = sformat.format(mydate);
&&&List&String[]&
list = Calendar(dateString);
&&&String[]
firstday = list.get(0);
&&&String[]
lastday = list.get(list.size() - 1);
&&&obj.setCurrentDate(mydate);
&&&obj.setFirstDay(firstday[0]);
&&&obj.setLastDay(lastday[0]);
&&&obj.setWeekOfYear(getWeekOfYear(dateString));
DateObj.java
---------------------------------------------------
import java.util.D
public class DateObj{
&private String firstDay,lastD
&private Date currentD
&public Date getCurrentDate(){
&return currentD
&public void setCurrentDate(Date
currentDate){
&this.currentDate = currentD
&private int weekOfY
&public String getFirstDay(){
&return firstD
&public void setFirstDay(String firstDay){
&this.firstDay = firstD
&public String getLastDay(){
&return lastD
&public void setLastDay(String lastDay){
&this.lastDay = lastD
&public int getWeekOfYear(){
&return weekOfY
&public void setWeekOfYear(int weekOfYear){
&this.weekOfYear = weekOfY
&@Override
&&& public
String toString(){
return "DateObj [firstDay=" + firstDay + ", lastDay=" + lastDay +
", currentDate=" + currentDate
&&&&&&&&&&&&
+ ", weekOfYear=" + weekOfYear + "]";
安卓开发中,设置EditText控件的属性:
android:singleLine="true"
设置单行输入,一旦设置,则文字不会换行。
java计算昨天和明天的方法
Date date = new Date();//取时间
&&Calendar calendar = new
GregorianCalendar();
&&calendar.setTime(date);
&&calendar.add(calendar.DATE,
-1);//把日期往后增加一天.整数往后推,负数往前移动
&&date = calendar.getTime();
//这个时间就是日期往后推一天的结果&&&&&&&
&&SimpleDateFormat formatter =
new SimpleDateFormat("yyyy-MM-dd");
&&String dateString =
formatter.format(date);
&&System.out.println(dateString);&
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。}

我要回帖

更多关于 今天是一年中的第几周 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信