c# - Discard functionality of "/" in CultureInfo -


what property in cultureinfo.invariantculture helps discard functionality of "/".

i having problem because have customculture. , when use format datetime replaces "/" culture specific separator.

so want know property if change in customculture functionality of "/" discarded.

let me clear problem,

i want export data file datetime specified user.

i creating customculture follows

cultureinfo customculture =  new cultureinfo(cultureinfo.currentculture.name); 

i taking date format user , injecting customculture object as

customculture.datetimeformat.shortdatepattern = myclass.dateformatfromuser; 

now when want convert string pattern. doing follows,

string.format(customculture, "{0:g}", datetimevalue); 

now problem string.format replaces "/" present in shortdatepattern customculture.datetimeformat.dateseparator

for example if user gives format

dd/mm/yyyy

and current culture faeroese ie., {fo-fo}

for these output 25-09-1990.

if want change custom culture date separator slash (/) looking datetimeformatinfo.dateseparator property:

customculture.datetimeformat.dateseparator = "/"; 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -