View Single Post
  #3 (permalink)  
Old Aug 14th, 2006, 07:37
snow snow is offline
Reputable Member
Join Date: Jul 2006
Location: Scotland
Age: 22
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Re: data representation of months in a web page

The best way I've found to get month names in ASP.net is by using:

Code: Select all
 
dim dtfi as System.Globalization.DateTimeFormatInfo = new System.Globalization.DateTimeFormatInfo
monthName = dtfi.getMonthName(monthNo)
So, then if monthNo was '03', then monthName would be March.


If you're getting the full date from a datasource, and I'm assuming you need to extract it from an an msSQL database, you'd need the query:

Code: Select all
SELECT DATEPART(mm,monthField) as theMonth


I made some very large assumptions when writing this - but I hope you can get something useful out of it!

Good luck,
Snow
Reply With Quote