how to get day in asp.net

Somebody come to this site by searching for "how to get day in asp.net"

well, here you go.

Response.Write(DateTime.Now.Day.ToString());

It will return day of the month (integer)

Response.Write(DateTime.Now.DayOfWeek.ToString());

It will return day of the week e.g. Sunday,Monday, Tuesday, etc.

Response.Write(DateTime.Now.DayOfYear.ToString());

It will return day of the year like 133 day out of 365

Tags:

I'm Satalaj More07/20/2007 08:42

Related posts

C#.net Get Yesterday.
You can get yesterday and today using DateTime add days method. Here we will see how to get today and yesterday's date in [C#.net] and [Vb.net].
P...Jquery Get Target Of Event Some times you need to find the target element of mouse click event. Here we will see how to get target element of mouse click. We have several elements insid...Getfilename GetExtension
Here is simple way to get file name or extension of the file at specified string.
you need to use System.IO namespace
e.g.
string pa...Asp.net Interview Questions for 2 years or 3 years experianceAsp.net interview questions
.net interview questions and answers.
Asp.net and MS sql server.
IIS interview questions
MS SQL Server interview questions
OOPS...DateTime.Today Vs DateTime.Now
What is difference between DateTime.Today and DateTime.Now? Here we will see examples of (VB.Net) and (C#.net)
[C#] example of DateTime Today
u...[Asp.net] Get current Page URL absolute URI and query string parameters.Here we will see how to get current page URL, absolute URI and query string parameters. we will use below URL. http://localhost:3716/web.Demo/Jquery_Tutorials...C#.net get tomorrows date
How to get tomorrows date and time in [C#] .net program? Let's see example of Vb.net and C#.net to get tomorrows date.
C#.net example to get Tom...How to get Jquery selected optionHere we will see how to get Selected value or Selected Text of dropdownlist using JQuery. To get selected text use $("#dropdownlistID").find(":selected").text()...

Category list

Author

My name is Satalaj,
but people call me Sat.
Here is my homepage:
www.revenmerchantservices.com.
I live in
Pune, PN and work as a Software Engineer. I'm former MVP in ASP.net year 2010.

Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer.
You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content
to other web sites. Feel free to copy or extend the code.