to display date in repeater in MM.dd.yyyy format
-
Hi, i have to extract datetime field of table in database stored in mm/dd/yyyy 12:00:00 and display it in repeater in MM.dd.yyyy format. Time should not be displayed ,date should be displayed in MM.dd.yyyy foemat only that is having dots not slashes. How can i achieve it? Is there any function in SQL to convert date format?.Please guide.
yog hui gfgh kgdgrt njjn hjgkn
-
Hi, i have to extract datetime field of table in database stored in mm/dd/yyyy 12:00:00 and display it in repeater in MM.dd.yyyy format. Time should not be displayed ,date should be displayed in MM.dd.yyyy foemat only that is having dots not slashes. How can i achieve it? Is there any function in SQL to convert date format?.Please guide.
yog hui gfgh kgdgrt njjn hjgkn
Try this: DateTime myDate = dateFromDB; string myDateStringForm = myDate.ToString("mm.dd.yyyy");
Sincerely, Elina Life is great!!! Enjoy every moment of it! :-O
-
Hi, i have to extract datetime field of table in database stored in mm/dd/yyyy 12:00:00 and display it in repeater in MM.dd.yyyy format. Time should not be displayed ,date should be displayed in MM.dd.yyyy foemat only that is having dots not slashes. How can i achieve it? Is there any function in SQL to convert date format?.Please guide.
yog hui gfgh kgdgrt njjn hjgkn
replace(convert(varchar,getdate(),101),'/','.')
--EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters
-
Try this: DateTime myDate = dateFromDB; string myDateStringForm = myDate.ToString("mm.dd.yyyy");
Sincerely, Elina Life is great!!! Enjoy every moment of it! :-O
-
i dont want to save it as an string i want to handle it as date how do you do that?
La Light
You need a string if you are binding it to a Text property of the control. If you do not want to declare a string variable, do it in one line: myControl.Text = myDate.ToString("MM.dd.yyyy");
Sincerely, Elina Life is great!!! Enjoy every moment of it! :-O