9/18/2014

Date and Time Format Strings in C#

Date and Time Format Strings in C#
Date and Time Format Strings in C#


private void dateTimePicker1_ValueChanged(object sender, EventArgs e)  
     {  
       label15.Text = dateTimePicker1.Value.ToString("d");  
       label16.Text = dateTimePicker1.Value.ToString("D");  
       label17.Text = dateTimePicker1.Value.ToString("f");  
       label18.Text = dateTimePicker1.Value.ToString("F");  
       label19.Text = dateTimePicker1.Value.ToString("g");  
       label20.Text = dateTimePicker1.Value.ToString("G");  
       label21.Text = dateTimePicker1.Value.ToString("m");  
       label22.Text = dateTimePicker1.Value.ToString("r");  
       label23.Text = dateTimePicker1.Value.ToString("s");  
       label24.Text = dateTimePicker1.Value.ToString("t");  
       label25.Text = dateTimePicker1.Value.ToString("T");  
       label26.Text = dateTimePicker1.Value.ToString("u");  
       label27.Text = dateTimePicker1.Value.ToString("U");  
       label28.Text = dateTimePicker1.Value.ToString("y");  
     }   

No comments:

Post a Comment