vb.net - Invalid Datime format conversion issue -


i have written this:

    dim sysformat = system.globalization.cultureinfo.currentculture.datetimeformat.shortdatepattern     dim formatdate = sysformat + " " + "h:mm:ss tt"     dim dtttm datetime = datetime.parseexact(value, formatdate, system.globalization.cultureinfo.invariantculture) 

and value value ! string "08/11/2017" , sysformat value m/d/yyyy invalid date format exception.

why invalid ? invalid in ?

yes, sysformat day, appending 12 hour time format. must include time am/pm in value

instead of "08/11/2017", use "08/11/2017 1:02:03 pm". work.


Comments

Popular posts from this blog

python 2.7 - Given three nested dictionaries, sort the top two nested dictionaries from a value in the innermost dictionary? -

angular - DownloadURL return null in below code -