@ Chris_techno25: I decided to extend the answer:
If we stick to the issue of Narashima, he wants a format ccyymmddhhmmss. So I scratched this extension method:
public static string IncludeCentury(this DateTime sourceDate, bool replace)
{
var source = String.Format("{0}/{1}", sourceDate.Year / 100 + 1, sourceDate);
if(replace)
return Regex.Replace(source, "[^0-9]", "");
else
return source;
}
Using:
var includingCentury = DateTime.Now.IncludeCentury(true)
var includingCentury = DateTime.Now.IncludeCentury(false)
Conclusion:
21218201491410
21/2/18/2014 9:18:10 AM
source
share