I want to find the sitecollection created and last content modified date in Sharepoint 2010, found a SPSite property for last content modified date however could not find any clue to find the created date. Is there a way to find the sitecollection created date?
The SiteData web service shows it as part of the WebMetaData. If you wanted strictly content only, I think you'd have to look at all the lists and libraries in the site and get the data on a per list/library level and get the most recent modification.
As Eric mentioned, it is exposed through the SiteData web service. I wanted to test it before I posted; note though that I believe you might have to be an administrator to execute the SiteData web service (that'd need another test to verify; I can't remember 100% either way).
For MOSS2007, we ended up using the created date of the Site Template Gallery because the created of the SPSite could potentially change (it was years ago, but I think restoring a site from backup would do it). As we're upgrading to SP2010, we are using the Solution Gallery, since the Site Template Gallery is gone. The code (minus all the error handling) looks like this:
site.RootWeb.Lists["Site Template Gallery"].Created
Also, be careful about last content modified date. We found that sometimes a system process would go through and update the last modified date of sites, even though nothing has changed. If you need to be sure, you can use SPSiteDataQuery to check all the contents of the site.
Try the following:
SELECT FullUrl, Title, TimeCreated FROM dbo.AllWebs