我做了一个社交网站,我班上的人可以问问题,然后它显示他们上传帖子的时间,但我有两个问题,首先它都是英语的,我的网站是丹麦语的。另一个问题是,当我刷新时,它会显示时间。我创建了一个像这样的while $row:
while($row = mysqli_fetch_assoc($select_all_posts_query)) {
$post_id = $row['post_id'];
$post_title = $row['post_title'];
$post_author = $row['post_author'];
$post_date = date("l H:i")
$post_image = $row['post_image'];
$post_content = substr($row['post_content'],0,100);
$post_tags = $row['post_tags'];
$post_comment_count = $row['post_comment_count'];
通过互联网搜索,但没有运气…你们能帮我解决这个问题吗?
"首先是英文的,我的网站是丹麦语的"
查看setlocale函数http://php.net/manual/en/function.setlocale.php
关于为什么显示当前日期,答案是:这将返回正在计算的代码的当前日期
date("l H:i")
你需要这样写:
date("l H:i", $row["someTimestampYouSaveWhenPostAdded"])