3-Sep-03 (Created: 3-Sep-03) | More in 'CS-dotnet'

Working with date/time in c#

How to convert datetime to a string

private string getTimeStamp(string timeformatString)
{
	DateTime dt = DateTime.Now;
	return dt.ToString(timeformatString);
}

Example time format strings

yyyyMMddHHmm

For more information on format strings look at: Docs on DateTimeFormatInfo