Problem CultureInfo

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?
 
C

Cor Ligthert [MVP]

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
 
D

Dragon

Hi,

Try this:

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

HTH
Roman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top