Problem CultureInfo

  • Thread starter Thread starter Giorgio
  • Start date Start date
G

Giorgio

I would to format the date in Italian ...(dd/mm/yyyy)

I have set an another language in International setting(for test i have set
Lettonia)
The format date for this nation is yyyy.mm.dd ...

I write this code for trasformation but not it works :

Dim DtInfo As DateTimeFormatInfo = New CultureInfo("it-IT",
False).DateTimeFormat
Dim ItCulture As CultureInfo = New CultureInfo("it-IT", False)
ItCulture.DateTimeFormat = DtInfo
DataOutput = DateTime.Parse(DataFromVerify, ItCulture)

How do?
 
Giorgio,

Probably do you have for testing purpose a computer with an English OS.

Normally should on an computer with an Italian OS the date be displayed as
dd/mm/yyyy

In my opinion it is better to avoid as much as possible to set hard codings
of cultures in your program.

I hope this helps,

Copr
 
Hi,

Try this:

~
DataOutPut = DateTime.Parse(DataFromVerify,
Globalization.CultureInfo.CreateSpecificCulture("it-IT").DateTimeFormat)
~

HTH
Roman
 
Back
Top