Why dateFormat Formatting doesnt work? what is absent in code?
First i try to set a specific culture's patterns but it doesnt work. If i set my Current culture to "tr-TR", then i cant set numberformatting. What can i do?
---
NOTE : I tried to set current cultures properties but it is readonly
System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortTimePattern = "dd/MM/yyyy"
it doesnt affect also doesnt throw any exception
---
Dim separatorFormat As New System.Globalization.NumberFormatInfo
Dim dateFormat As New System.Globalization.DateTimeFormatInfo
'If separatorFormat.CurrentInfo.NumberDecimalSeparator = "," Then
System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US")
separatorFormat.NumberDecimalSeparator = "."
separatorFormat.NumberGroupSeparator = ","
'Dim ci As New System.Globalization.CultureInfo("tr-TR")
dateFormat.LongDatePattern = "dddd, dd MMMM yyyy" ' ci.DateTimeFormat.LongDatePattern"
dateFormat.ShortDatePattern = "dd/MM/yyyy" 'ci.DateTimeFormat.ShortDatePattern
dateFormat.LongTimePattern = "HH:mm:ss" 'ci.DateTimeFormat.LongTimePattern
dateFormat.ShortTimePattern = "HH:mm" 'ci.DateTimeFormat.ShortTimePattern
'End If
First i try to set a specific culture's patterns but it doesnt work. If i set my Current culture to "tr-TR", then i cant set numberformatting. What can i do?
---
NOTE : I tried to set current cultures properties but it is readonly
System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortTimePattern = "dd/MM/yyyy"
it doesnt affect also doesnt throw any exception
---
Dim separatorFormat As New System.Globalization.NumberFormatInfo
Dim dateFormat As New System.Globalization.DateTimeFormatInfo
'If separatorFormat.CurrentInfo.NumberDecimalSeparator = "," Then
System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US")
separatorFormat.NumberDecimalSeparator = "."
separatorFormat.NumberGroupSeparator = ","
'Dim ci As New System.Globalization.CultureInfo("tr-TR")
dateFormat.LongDatePattern = "dddd, dd MMMM yyyy" ' ci.DateTimeFormat.LongDatePattern"
dateFormat.ShortDatePattern = "dd/MM/yyyy" 'ci.DateTimeFormat.ShortDatePattern
dateFormat.LongTimePattern = "HH:mm:ss" 'ci.DateTimeFormat.LongTimePattern
dateFormat.ShortTimePattern = "HH:mm" 'ci.DateTimeFormat.ShortTimePattern
'End If
Last edited: