! This article may No update for more than 2 years In the future, the content may not be maintained or supported. Some of the content may be timely, involving technical details or software use. This article does not guarantee the corresponding technical updates and practical operability.
How does typecho add creation time&last modification time to each file? The seemingly useless function is really important to me now. For example, every time I search for content, I want to know when the content is written, but sometimes the author hides the timestamp and cannot find it, so I cannot determine whether the content is suitable! Afraid of wasting time and energy. I wonder if you have this experience?
So i want to add the creation time&the last modification time; On the one hand, you can easily check the friends, on the other hand, you can update and maintain yourself when you are in a good mood.
How to add?
Each theme may differ slightly from my theme( Moricolor )As an example subject root directory
lower post.php
Found in file content
code
<? php parseContnet($this->content); ?>
stay content
Add below, as follows
//I don't want to add it to css, so how to make it simple? Hybrid
<!-- The bottom of the typecho page displays the start of creation&modification --> <hr /> <font color="#FF0000"> <? Php _e ('first creation time: ');?><? php $this->date('Y-m-d H:i:s'); ?> <br /> <? Php _e ('last modification time: ');?><? php echo date('Y-m-d H:i:s', $this->modified);?> </font> <!-- The bottom of the typecho page displays the end of creation&modification time -->
Instance picture
First creation time: 2018-12-02 09:22:00
Last modification time: 2020-08-19 21:55:23