Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
how to set date format in checkbox listbox items in c#
Posted 31-Jan-13 1:03am
123abhi411
Comments
Santhosh Kumar J at 31-Jan-13 6:08am
   
what format you want?
Balamurugan1989 at 31-Jan-13 6:10am
   
In Which Format you need to set date???Elaborate your Questions???
J.Surjith Kumar at 2-Feb-13 8:33am
   
Explain in detail. Improve question is there to edit the question.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If you are binding it with some data source then you are required to select the date format at the time of data selection (i.e. if db source is SQL then format it at SQL level)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

If you want to Display the System date means you should follow the below code,
 
textBox1.Text = DateTime.Now.ToShortDateString();
textBox2.Text = DateTime.Now.ToShortTimeString();
 

It depends on Textbox or listbox. I have written for displaying the system time in textbox.
  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

textBox1.Text=DatTime.Now.ToString("dd-MM-yyyy")
02-02-2013
 
textBox2.Text=DatTime.Now.ToString("dd-MMM-yyyy")
02-Feb-2013
  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 515
1 Maciej Los 349
2 Richard MacCutchan 220
3 BillWoodruff 209
4 Mathew Soji 160
0 OriginalGriff 8,654
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,229
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 2 Feb 2013
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