Click here to Skip to main content
11,705,610 members (49,885 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Windows VB.NET
Hi all

Please tell me how to format the datetime.
i wan tthe format like this

December, 24 2012 and want to display it in a label

Thank you
Posted 23-Dec-12 21:36pm
Code-Hunt7.1K
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Provided you local is en-US (or compatible) then
MyLabel.Text = dt.ToString("MMMM, dd yyyy");
should do the trick (see the documentation[^]).
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 24-Dec-12 12:35pm
   
Yes, especially if OP finds it tricky to find it out on just one of 3 MSDN pages... a 5.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Need help? Such help is already written for your:
http://msdn.microsoft.com/en-us/library/system.datetime.aspx[^] (see the methods ToString here),
http://msdn.microsoft.com/en-us/library/az4se3k1.aspx[^],
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx[^].

After looking at this pages, you will see that your problem is quite trivial and will easily solve it.

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

Solution 4

Take datetimepicker. and take current date and assigned it to the label.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 213
1 Sergey Alexandrovich Kryukov 160
2 Inimicos 60
3 ProgramFOX 50
4 Richard MacCutchan 45
0 OriginalGriff 9,053
1 Sergey Alexandrovich Kryukov 8,347
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,626


Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 24 Dec 2012
Copyright © CodeProject, 1999-2015
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