thukralz

Hello,

How can we find out which week or Year we are in now

Is there any function to achieve that ...

Thanks



Re: Visual C# General How to find which week we are in ?

George Olson

You can use DateTime.Now. I think you will have to get creative for the week.

Code Snippet

Console.WriteLine(DateTime.Now.Year);

Console.WriteLine(DateTime.Now.Day);

Console.WriteLine(DateTime.Now.Month);





Re: Visual C# General How to find which week we are in ?

.NETPhreak

There is a very useful class that is not used as often as it should be in the System.Globalization namespace - this is not the only one, by the way... the namespace contains numerous other useful classes and they need to be advertized more.

http://msdn2.microsoft.com/en-us/library/system.globalization.calendar.getweekofyear(VS.71).aspx

Calendar.GetWeekOfYear Method