Your mistake is to use new DateTime() , which returns January 1, 0001 at 00: 00: 00.000 instead of the current date and time. The correct syntax for getting the current date and time is DateTime.Now , so change this:
String timeStamp = GetTimestamp(new DateTime());
:
String timeStamp = GetTimestamp(DateTime.Now);
ekad Jan 19 '14 at 17:05 2014-01-19 17:05
source share