private string getTimeStamp(string timeformatString) { DateTime dt = DateTime.Now; return dt.ToString(timeformatString); }
yyyyMMddHHmm
For more information on format strings look at: Docs on DateTimeFormatInfo