c# datetime.parseexact string was not recognized as a valid datetime -


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

Popular posts from this blog

android - Sent Blob results empty -

javascript - Bootstrap Popover: iOS Safari strange behaviour -