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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -