Last post Sep 06, 2014 04:25 AM by MetalAsp.Net
Sep 06, 2014 02:54 AM|UtpalMaity|LINK
I am facing a problem regarding the datetime manipulation of ISO 8601 format. The problem is that I have a date string like this string date = "2014-09-05T23:39:57-04:00"; . With this date string I need to add additional 2 seconds with this date . But when
I tried to convert this string using the datetime.parse method for adding 2 second , the datetime.parse method is changing the date to "9/6/2014 9:09:57 AM". But I need the result like this
string calculateddate = "2014-09-05T23:39:59-04:00";
How to achieve that.
Sep 06, 2014 04:25 AM|MetalAsp.Net|LINK
Use ParseExact() which allows you to specify the format of the date string.