Hi,
I use the below code to get the created date for a file.
It gets the datetime based on regional settings, but the seconds part is always 00.
System.Globalization.CultureInfo culture = web.Locale;
SPList library = web.Lists[libraryID];
SPFile existingFile = library.GetItemById(itemID).File;
string createdDate = SPUtility.FormatDate(web, existingFile.TimeCreated, SPDateFormat.DateTime);
DateTime dateCreatedOn = Convert.ToDateTime(createdDate, culture);
How to get seconds value using SPUtility.FormatDate?
Thanks in advance,
dhijit