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

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Website Login Issue developed in magento -

Can the constants be defined inside a model file of a framework in PHP? -