Click here to Skip to main content
11,492,639 members (59,389 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 22: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 Sergey Alexandrovich Kryukov 454
1 Maciej Los 286
2 F-ES Sitecore 224
3 KarstenK 210
4 CPallini 208
0 Sergey Alexandrovich Kryukov 10,062
1 OriginalGriff 8,620
2 Sascha Lefèvre 3,609
3 Maciej Los 3,372
4 Richard Deeming 2,500


Advertise | Privacy | Mobile
Web01 | 2.8.150520.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