Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I used a calender controller to insert a date to one of my forms used in ASP.Net. But the text-box shows the date as a short date. All I want is to display the date as a long date for better viewing.

I used VB 2005 with ASP.Net 2.0
Posted

1 solution

Format the date with the ToString function, with the Long Date format string: "F"
VB
Console.WriteLine(dt.ToString("F"))
There is a list of the format codes here: Formatting a DateTime for display - format string description[^]
 
Share this answer
 
Comments
Chiranthaka Sampath 17-Dec-11 3:29am    
But my dear friend all I want is to display the date in full in the web browser not in the vb console! Please try to solve my question!
OriginalGriff 17-Dec-11 4:21am    
Use your brain: the Console.Writeline was to show you what the output would look like. I do not know what your control names are, where in your code you are putting this, etc., etc., etc..
Chiranthaka Sampath 17-Dec-11 22:39pm    
Ah thanx !

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900