Iam using ASP, I need DD-MM-YYYY HH:MM:SS AM/PM Format instead of mm/dd/yyyy hh:mm:ss am/pm . Can any one help me solve this issue, Thanks in advance.
You can use any culture that supports the dd-mm-yyyy format like the french one. For example to format the date time now in a format dd-mm-yyyy you can do as follows: cultureInfo culture = new cultureinfo("fr-FR"); string oFormatedDate = dtNow.ToString("d", culture); www.vbisbetter.com
Either that, or you can specify the date/time format directly as the parameter of the ToString method: string dateTime = DateTime.Now.ToString("dd-MM-yyyy hh:mm:ss"); EDIT: I just noticed you want to show AM/PM as well, you can show that if you add "tt" in your format string: string dateTime = DateTime.Now.ToString("dd-MM-yyyy hh:mm:ss tt");