Convert String value format of YYYYMMDDHHMMSS to C# DateTime

Posted by SARAVAN on Stack Overflow See other posts from Stack Overflow or by SARAVAN
Published on 2010-06-11T20:14:37Z Indexed on 2010/06/11 20:22 UTC
Read the original article Hit count: 262

Filed under:
|
|

I have a need to convert a string value in the form "YYYYMMDDHHMMSS" to a DateTime. But not sure on how, may be a DateTime.Tryparse can be used to make this happen. Or is there any other way to do it. I can do this using some string operations to take "YYYYMMDD" alone, convert to a datetime and then add HH, MM, SS separately to that DateTime. But is there any DateTime.TryParse() methods that I can use in one line to convert a "YYYYMMDDHHMMSS" format string value to a DateTime value?

© Stack Overflow or respective owner

Related posts about c#

Related posts about datetime