How to convert string into datetime in asp.net C#


In this article, we will learn about the how to convert the string value into datetime.


Code behind(C#):-

        string strdate = "24/04/2015";

        DateTime datetime = Convert.ToDateTime(strdate);

        Label1.Text = datetime.ToString();


Out-put:-

How to convert string into datetime in asp.net C# How to convert string into datetime in asp.net C# Reviewed by NEERAJ SRIVASTAVA on 9:55:00 AM Rating: 5

No comments:

Powered by Blogger.