Convert string to date in C# / .NET Framework

visibility 224 access_time 2y languageEnglish

This code snippet shows how to convert string to date.

DateTime.Parse can be used to convert datetime string to DateTime type in C#/.NET.

Code snippet

var dateString="2017-10-15";
var date=DateTime.Parse(dateString);
Console.WriteLine(date);
Console.ReadLine();
info Last modified by Raymond 2y copyright This page is subject to Site terms.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

timeline Stats
Page index 0.23
local_offer Tags