c# - Convert US date time to Indian date time format -


this question has answer here:

i've been trying convert date indian format cultureinfo hi-in. trying below code, not getting successful result. missing?

//item.value=2/27/1998 3:56:98  datetime.parseexact(item.value, "dd/mm/yyyy", system.globalization.cultureinfo.getcultureinfo("hi-in")) 

i tried this:

timezoneinfo timezoneinfo; datetime datetime; //set time zone information mountain standard time  timezoneinfo = timezoneinfo.findsystemtimezonebyid("india standard time"); //get date , time in mountain standard time  datetime =  timezoneinfo.converttime(convert.todatetime(item.value), timezoneinfo); 

is there way can date format in "dd/mm/yyyy"?

please use following code....

 var time = datetime.parse(datetime.now.tostring());         var clientzone = timezoneinfo.findsystemtimezonebyid("india standard time");         var utctime = timezoneinfo.converttimetoutc(time, clientzone).tostring("dd/mm/yyyy"); 

Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -