c# - Why am I unable to convert Datetime to the required format -


this requirement

i having field declared in class file datetime.

i taking string , convert datetime filed in class in date time

i pass

    string date="9999-12-31 00:00:00" 

i convert date time output format should same given string

quite simply, you're trying parse "9999-12-31" format string of "yyyy-mm-ddthh:mm:ss" - doesn't comply to, has no time.

edit: okay, you've changed input "9999-12-31 21:34 pm" still isn't in appropriate format - there's no t, no seconds, , there's am/pm designator. why not using format string matches input?

but if "9999-12-31" input, output expecting?


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -