Convert string to datetime and datetime to string in C#
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);
Related posts:
- Magento: Convert Price from Current Currency to Base Currency and vice-versa
- PHP: How to get integer or decimal from a string?
- PHP: Simple and easy way to format URL string
- PHP: Generating Multiple Random String
- Random number, string generation in PHP
- PHP: Parse Unparse String Array
- Javascript: How to get current URL without Query string?
- jQuery: How to replace string, div content and image src?
