how to get day in asp.net

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:

how to get day in asp.netJquery Get Target Of EventGetfilename GetExtensionAsp.net Interview Questions for 2 years or 3 years experianceDateTime.Today Vs DateTime.Now[Asp.net] Get current Page URL absolute URI and query string parameters.C#.net get tomorrows dateHow to get Jquery selected optionASP.net File HandlingASP.net monitor server Asp.net Cache Object

Author

My name is Satalaj, but people call me Sat. Here is my homepage: . 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.
If you want to fight with me, this website is not for you.
 

I'm Satalaj.