Administrator Admin
Number of posts : 160 Age : 38 Location : Lucknow Job/hobbies : Software Engeener What U like To do ? : Because Its Rock with me. Registration date : 2008-01-06
| Subject: Extract Date From Date time data type in c# 2/29/2008, 8:08 pm | |
| lb_display is the lable name where the result will be shown. Suppose "11/2/2003 12:00:00" this is the value which is stored in the data base when you declare the row as date time in database now if you want the date from datetime data type then FOR C# CODE - Code:
-
Lb_Display.Text = [color=#008080]DateTime[/color].Parse(Ds.Tables[0].Rows[0][7].ToString ()).ToShortDateString (); or Lb_Display.Text = [color=#008080]DateTime[/color].Parse('11/2/2003 12:00:00 Am').ToShortTimeString ();
Result will be "11/2/2003" | |
|