c# datetime.parseexact string was not recognized as a valid datetime -
this question has answer here:
below code throws exception on local, not on server.
datetime date = datetime.parseexact("01/06/2015", "dd/mm/yyyy", null); like said works on server, throws 'system.formatexception' on local. assume might problem of cultural settings. don't know can into.
could me?
try this:
datetime date = datetime.parseexact("01/06/2015", "dd/mm/yyyy", cultureinfo.invariantculture); if don't specify culture use whatever current culture settings are. since know format should supply invariantculture.
Comments
Post a Comment