简体   繁体   English

如何在 2sxc razor 模板中输出项目的创建、发布和修改日期/时间?

[英]How can I output the item’s creation, published, and modified date/time in a 2sxc razor template?

I have a 2sxc content list of items which use ac# razor template.我有一个使用 ac# razor 模板的项目的 2sxc 内容列表。 For each item, I want to display:对于每个项目,我想显示:

  1. The item's creation date/time (when the editor made the item)项目的创建日期/时间(编辑者创建项目的时间)
  2. The item's modified date (when it was last edited since creation)项目的修改日期(自创建以来最后一次编辑的时间)
  3. The item's publish date (when it first appeared in this particular module's list)项目的发布日期(首次出现在此特定模块列表中的时间)

What c# code can I drop in the template to display these dates/times?我可以在模板中放入哪些 C# 代码来显示这些日期/时间?

An entity has a Modified property (also EntityEid and some others).一个实体有一个 Modified 属性(还有 EntityEid 和其他一些属性)。

I'm not sure about the others.我不确定其他人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM