Parsing date


i Try to parse string to date time, but i get this error:
image

the parse must work for combinations:
“1.1.2099”,“11.1.2099”,“1.11.2099”,“11.11.2099”

Hi @tomaz

Try this:

DateTime.ParseExact(ZarvarvanjeVeljaDO,{"d.M.yyyy","dd.MM.yyyy","MM.d.yyyy","d.MM.yyyy","MM.dd.yyyy"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None)

Regards

Hi @tomaz

Could you try with this,

DateTime.ParseExact(ZarvarvanjeVeljaDO,"dd.M.yyyy",System,globalization.Cultureinfo.InvariantCulture)

It was in the dd.M.yyyy format not in the dd.MM.yyyy format.

Hope it helps!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.