Visual Studio .NET - System.DateTime.Now showing date time as UK format. How to show in US format(mm/dd/yyyy)?
Asked By suresh krishna on 28-Sep-12 01:53 AM
My Local Regional setting is US format. But when getting values from now date it giving
date as 'dd/MM/yyyy' not mm/dd/yyyy.. how to resolve? Plz suggest me.
with Thanks,
Suresh .K
Danasegarane Arunachalam replied to suresh krishna on 28-Sep-12 02:13 AM
Convert the Date using the Format of the Datetime method
DateTime.Now.Tostring("MM/dd/yyyy") will print the date in Month/Date/Year Format
sri replied to suresh krishna on 28-Sep-12 09:53 AM
DateTime.Now.Tostring("MM/dd/yyyy") ;
Hemanth Kumar replied to suresh krishna on 01-Oct-12 01:42 AM
Suresh Kirshna,
Convert the DateTime to according to the Format Required.See this example
Convert.ToString(DateTime.Now).ToStriing("MM/dd/yyyy");
Jitendra Faye replied to suresh krishna on 01-Oct-12 01:43 AM
While getting date from date object you can pass different patten to get date.
try like this-
DateTime.Now.Tostring("MM/dd/yyyy")