convert string to formatted datetime c# code example Example: c# string to datetime .Net str to DateTime