Click here to Skip to main content
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
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 Kornfeld Eliyahu Peter 169
1 George Jonsson 145
2 Zoltán Zörgő 139
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,382


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 24 Dec 2012
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