Datetime.parse In C# Code Example


Example 1: parse datetime c#


using System.Globalization;
DateTime.ParseExact("20200101123000", "yyyyMMddHHmmss", CultureInfo.InvariantCulture)

Example 2: string to datetime c#


DateTime.TryParse(stringDate, out DateTime date);
//date variable type is DateTime

Comments

Popular posts from this blog

Android - ImageView With Rounded Only One Corner

530 Valid Hostname Is Expected When Setting Up IIS 10 For Multiple Sites

Android - SetOnClickListener Vs OnClickListener Vs View.OnClickListener