c# - Datetime Formatting giving it a specific culture doesn't change how day is printed out -


is datetime format strictly dependent on language of os being used? because following doesn't work:

datetime date = datetime.now; var uscultureinfo = cultureinfo.createspecificculture("en-us"); console.writeline(date.tostring("dddd mm-dd-yy"),uscultureinfo); 

i'd result print out saturday, 06-29-2013 day gets printed out in korean 토요일, 06-29-2013.

you victim of composite formatting overload console.writeline pass format string , series of object inserted in placeholders of format string

you need write in way

console.writeline(date.tostring("dddd mm-dd-yy",uscultureinfo)); 

and right day text.

see specs here datetime.tostring(format, iformatprovider)


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -