4

Simple question, I think: is there a value, either in the API or the Web database, that will tell me the last time content was published using sitecore? It looks like there's an "Updated" column in the "Items" table that might do this, but I'd like to be sure. I don't need to know individual items, just the last time any content was published.

4

2 回答 2

8

如果(即当且仅当)发布是完整站点发布或增量发布,Sitecore 会将该日期记录到数据库中,并且可以使用从主数据库中检索它

Database.Properties.GetLastPublishDate(Database target, Language language)

否则,如果您想要任何发布的日期,您可能需要创建一个发布管道处理器以在某处记录该日期。

于 2012-09-13T23:34:08.253 回答
4

我在寻找类似的东西时遇到了这个。像这样的东西对我有用:

public String PostDate()
{
    DateTime postDate = Context.Item.Statistics.Updated;
    return postDate != null ? postDate.ToString("MMMM dd yyyy H:mm:ss tt") : String.Empty;
}
于 2013-06-13T12:15:34.807 回答