Home » C#

Convert string to datetime and datetime to string in C#

27 January 2009 743 views Popularity: 2% Share/Bookmark

convert string to datetime

string datestring = “18 March 2008″;
DateTime parseddate = Convert.ToDateTime(datestring);
Response.Write(parseddate);

convert datetime to string

DateTime dtime = DateTime.Today;
string date = dtime.ToString(“yyyyMMdd”);
Response.Write(date);

From Mukesh Chapagain's Blog, post Convert string to datetime and datetime to string in C#

Related posts:

  1. Magento: Convert Price from Current Currency to Base Currency and vice-versa
  2. PHP: How to get integer or decimal from a string?
  3. PHP: Simple and easy way to format URL string
  4. PHP: Generating Multiple Random String
  5. Random number, string generation in PHP
  6. PHP: Parse Unparse String Array
  7. Javascript: How to get current URL without Query string?
  8. jQuery: How to replace string, div content and image src?
  • http://www.getaxhtmlcoder.com Psd To Css Conversion

    It’s nice to find a good article. I really enjoy lots of the blog posts on your web site.

  • http://www.getaxhtmlcoder.com Psd To Css Conversion

    It’s nice to find a good article. I really enjoy lots of the blog posts on your web site.