Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

SPUtility.FormatDate does not get seconds value

$
0
0

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


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>