This is a discussion on Datetime datatype formate within the ASP and ASP.NET Programming forums, part of the Web Development category; Hello, I created a sql table with a field DateTime. I inserted a date value as 2/2/2008 to ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hello, I created a sql table with a field DateTime. I inserted a date value as 2/2/2008 to this field. While viewing this value from the DB in a textbox i got the value 2/2/2008 12:00 AM. HOw to filter the 12:00 AM and get onlly the date? I wrote the program in ASP.NET. -Kirubha |
| Sponsored Links |
| |||
| Hi Kirubhananth, Its very simple to filter the time from the DateTime. Try this... Code: DateTime.Parse(DBstring).ToShortDateString(); // the DBstring the value you fetched from the database. |
| |||
| Hi Kirubhananth, Try this u can get Date-Time in ur required format like this text1.Text = DateTime.Now.Day.ToString() +"/"+ DateTime.Now.Month.ToString()+"/"+ DateTime.Now.Year.ToString(); Output Date:23/2/2008 |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/asp-asp-net-programming/5297-datetime-datatype-formate.html | |||
| Posted By | For | Type | Date |
| DiscussWeb IT Community - Technical Support and Technology Discussions | This thread | Refback | 03-10-2008 05:42 AM |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I am getting 'String was not recognised as a valid DateTime' | poornima | ASP and ASP.NET Programming | 2 | 02-01-2008 11:17 PM |
| XmlSerializer throws a exception: String was not recognized as a valid DateTime. | kingmaker | C# Programming | 2 | 01-19-2008 11:19 PM |
| Storing NULL value to other than string datatype | muthuramkumar | ASP and ASP.NET Programming | 1 | 03-19-2007 03:17 AM |