Click here to Skip to main content
12,510,403 members (49,903 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB 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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160929.1 | Last Updated 24 Dec 2012
Copyright © CodeProject, 1999-2016
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