Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB9.0
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 16-Dec-11 21:20pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Format the date with the ToString function, with the Long Date format string: "F"
            Console.WriteLine(dt.ToString("F"))
There is a list of the format codes here: Formatting a DateTime for display - format string description[^]
  Permalink  
Comments
Chiranthaka Sampath at 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 at 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 at 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)

  Print Answers RSS
0 Mathew Soji 274
1 BillWoodruff 270
2 Afzaal Ahmad Zeeshan 244
3 Sergey Alexandrovich Kryukov 240
4 Raul Iloc 160
0 OriginalGriff 6,219
1 Sergey Alexandrovich Kryukov 5,853
2 DamithSL 5,103
3 Manas Bhardwaj 4,549
4 Maciej Los 3,845


Advertise | Privacy | Mobile
Web03 | 2.8.1411019.1 | Last Updated 17 Dec 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100