Good, as an experienced website operation expert, I know that every detail can affect user experience.In AnQi CMS, present the publishing time of the comment list in a clear and understandable way, which can not only improve the user experience but also make the website content look more timely and professional.Today, let's delve into how to cleverly use it in the comment list of Anqi CMSstampToDateTags, making the posting time of each comment clear at a glance.
Refined time presentation: How to use in Anqi CMS comment liststampToDateDisplay posting time
In the era where content is king, the interactivity of a website is the key to attracting and retaining users.The comment section is an important battlefield for user communication, and the way its content is presented directly affects the enthusiasm of users participating.AnQi CMS is an efficient and flexible content management system that provides powerful template customization capabilities.Among the seemingly minor features that can greatly enhance user experience is the conversion of the original timestamp format of comments to the date and time format we are accustomed to.This is exactly itstampToDatethe application of tags.
Get to knowstampToDate: The magician of time formatting
In the template system of Anqi CMS,stampToDateIt is a very practical built-in tag, which is specifically used to convert the Unix timestamp (usually a 10-digit number) stored in the database into a date and time string that is easy to read. Imagine if the comment time displayed was1678886400, ordinary users can't understand what this represents when. And throughstampToDateWe can convert it to a clear and understandable format such as '2023-03-15 10:00:00'.
The use of this tag is very intuitive:{{stampToDate(时间戳, "格式")}}.
Among them,时间戳It is the 10-digit number we need to convert and so on.格式It is a string that defines the final appearance you want the time to present. It is especially important to note that the AnQi CMS'sstampToDateThe time format string supported by the label, which follows the Go language formatting specification. This means you need to use a special "reference time"2006-01-02 15:04:05To build the format you want.
For example:
- If you want to display “Year-Month-Day”:
"2006-01-02" - If you want to display “Year/Month/Day”:
"2006/01/02" - If you want to display \