如何在C#中查找一周的一周?

编程入门 行业动态 更新时间:2024-10-23 23:26:29
本文介绍了如何在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#中查找一周的一周?

本文发布于:2023-11-27 05:16:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636753.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!