Friday, 15 January 2010

c# - DateTime.ParseExact raises FormatException -



c# - DateTime.ParseExact raises FormatException -

the code:

datetime.parseexact("2/2/2002", "dd/mm/yyyy", system.globalization.cultureinfo.invariantculture)

is raising system.formatexception.

i'll appreciate if tell me doing wrong.

it should d/m/yyyy

datetime.parseexact("2/2/2002", "d/m/yyyy", system.globalization.cultureinfo.invariantculture)

the reason of exception converts 2 places dd string found 2/.

c# .net datetime

No comments:

Post a Comment