I have a table called X, and this table has a field known as X_DateTime respectively, which has a value similar to 2012-03-11 09: 26: 37.837.
I want to convert the above datetime value to this format yyyy-MM-dd (2012-03-11) and literally delete Time (09: 26: 37.837)
I used something like the code below
DateTimeFormatInfo format = new DateTimeFormatInfo();
format.ShortDatePattern = "yyyy-MM-dd";
format.DateSeparator = "-";
DateTime date = 2012-03-11 09:26:37.837;
DateTime shortDate = Convert.ToDateTime(date , format);
Please help me...
I use C # as my language.
thank,
source
share