now date in c#.net convert MMddyyyyHHmmss code example Example: C# datetime.now to string only numbers DateTime.Now.ToString("yyyyMMddHHmmss"); // case sensitive