Convert string to date in C# / .NET Framework

visibility 176 comment 0 access_time 10 months ago

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);
info Last modified by Raymond 10 months ago copyright This page is subject to Site terms.

Subscribe newsletter

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

More from Kontext

Run .NET 5 on Azure App Services
visibility 407
thumb_up 0
access_time 12 months ago
visibility 687
thumb_up 0
access_time 2 years ago