fix: 修复评论时间显示不一致的问题
- 将 human_time_diff() 的两个参数统一使用 GMT 时间戳
- get_comment_time('U', true) 返回 GMT 时间戳
- current_time('timestamp', true) 返回 GMT 时间戳
- 确保时间差计算使用相同时区,避免时区转换导致的时间偏差
- 修复了刚发送的评论显示为 8 小时前的问题
This commit is contained in:
@@ -2069,7 +2069,7 @@ function argon_comment_format($comment, $args, $depth){
|
|||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<div class="comment-time">
|
<div class="comment-time">
|
||||||
<span class="human-time" data-time="<?php echo get_comment_time('U', true);?>"><?php echo human_time_diff(get_comment_time('U') , current_time('timestamp')) . __("前", "argon");?></span>
|
<span class="human-time" data-time="<?php echo get_comment_time('U');?>"><?php echo human_time_diff(get_comment_time('U', true), current_time('timestamp', true)) . __("前", "argon");?></span>
|
||||||
<div class="comment-time-details"><?php echo get_comment_time('Y-n-d G:i:s');?></div>
|
<div class="comment-time-details"><?php echo get_comment_time('Y-n-d G:i:s');?></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user