本文介绍了如何在C#中查找一周的一周?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨 我没有从互联网上找到任何解决方案如何做到这一点。有很多 样本如何检索一周中的某一天,但不是一周中的数字。 使用rgds MP
Hi I did not find any solution from Internet how to do it. There is a lot of samples how to retrieve day of the week, but not number of the week. With rgds MP
推荐答案这会做你想要的吗?: 将日期视为昏暗DateTime = DateTime.Now Dim WeekOfYear as integer = Math.Ceiling(theDate.DayOfYear / 7) news:45 ********************************** @ microsof t ... would this do what you want?: Dim theDate as DateTime = DateTime.Now Dim WeekOfYear as integer = Math.Ceiling(theDate.DayOfYear / 7) "purkka" <pu****@discussions.microsoft> wrote in message news:45**********************************@microsof t... 嗨 我没有从互联网上找到任何解决方案如何做到这一点。有很多样本如何检索星期几,但不是一周的数量。 使用rgds MP Hi I did not find any solution from Internet how to do it. There is a lot of samples how to retrieve day of the week, but not number of the week. With rgds MP
试试这个: System.Globalization.CultureInfo myCI = new CultureInfo(" en-US"); myCI.Calendar.GetWeekOfYear(DateTime.Now, System.Globalization.CalendarWeekRule.FirstFourDay Week, System.DayOfWeek.Sunday); 问候, Wessel -----原帖----- 来自:purkka [mailto:pu **** @ discussion.microsoft] 发表于:2005年4月11日星期一下午1:02 发布至:microsoft.public.dotnet.framework.aspnet 对话:如何在C#中查找一周的一周? 主题:如何找出一周的在C#的一天? 您好 我没有从互联网上找到任何解决方案如何做到这一点。有很多 样本如何检索星期几,而不是一周中的数字。 随着rgds MP Try this: System.Globalization.CultureInfo myCI = new CultureInfo("en-US"); myCI.Calendar.GetWeekOfYear( DateTime.Now, System.Globalization.CalendarWeekRule.FirstFourDay Week, System.DayOfWeek.Sunday ); Greetings, Wessel -----Original Message----- From: purkka [mailto:pu****@discussions.microsoft] Posted At: Monday, April 11, 2005 1:02 PM Posted To: microsoft.public.dotnet.framework.aspnet Conversation: How to find out a week of the day in C#? Subject: How to find out a week of the day in C#? Hi I did not find any solution from Internet how to do it. There is a lot of samples how to retrieve day of the week, but not number of the week. With rgds MP
Hoops 对不起。我没有提到,我的ASP.NET应用程序从Access db获取日期值 (1/2 / 2005,11 / 2/2005 ...)。值显示为 数据网格中的列表,该列表还应提供如下的周数: 周日期名称..... ------------------------------- 15 12.4.2005 John Smith。 .... 带rgds MP " Wessel Troost"写道: Hoops Sorry. I did not mentioned, that my ASP.NET application fetch datevalues (1/2/2005, 11/2/2005...) from Access db. Values are shown as a list in a datagrid which should also provide week numbers like this: Week Date Name ..... ------------------------------- 15 12.4.2005 John Smith ..... With rgds MP "Wessel Troost" wrote: 试试这个: System.Globalization.CultureInfo myCI = new CultureInfo(" en-US"); myCI.Calendar .GetWeekOfYear(DateTime.Now, System.Globalization.CalendarWeekRule.FirstFourDay Week, System.DayOfWeek.Sunday); 问候, Wessel -----原帖----- 来自:purkka [mailto:pu **** @ discussion.microsoft] 发表时间:4月11日星期一, 2005 1:02 PM 发布到:microsoft.public.dotnet.framework.aspnet 对话:如何在C#中查找一周的一周?主题:如何找出一个C#一天中的一周? 您好 我没有从互联网上找到任何解决方案如何做到这一点。有很多的样本如何检索一周中的某一天,而不是每周的数量。 使用rgds MP Try this: System.Globalization.CultureInfo myCI = new CultureInfo("en-US"); myCI.Calendar.GetWeekOfYear( DateTime.Now, System.Globalization.CalendarWeekRule.FirstFourDay Week, System.DayOfWeek.Sunday ); Greetings, Wessel -----Original Message----- From: purkka [mailto:pu****@discussions.microsoft] Posted At: Monday, April 11, 2005 1:02 PM Posted To: microsoft.public.dotnet.framework.aspnet Conversation: How to find out a week of the day in C#? Subject: How to find out a week of the day in C#? Hi I did not find any solution from Internet how to do it. There is a lot of samples how to retrieve day of the week, but not number of the week. With rgds MP
更多推荐
如何在C#中查找一周的一周?
发布评论