$userid), "id", "DESC", "0,5"); $la-6ren">
gpt4 book ai didi

php - 秒到分钟 :seconds from mysql to smarty

转载 作者:行者123 更新时间:2023-11-30 23:12:58 25 4
gpt4 key购买 nike

我有这个问题

$result = select_query("tblemails", "", array("userid" => $userid), "id", "DESC", "0,5");
$lastfivemail = array();
while ($data = mysql_fetch_array($result))
{
$lastfivemail[] = array("id" => $data["id"], "processtime" => $data["processtime"], "date" => frommysqldate($data["date"], "time"), "subject" => $data["subject"] ? $data["subject"] : "No Subject");
continue;
}
$templatevars["lastfivemail"] = $lastfivemail;

还有这个

"processtime" => $data["processtime"]

以秒为单位显示发送电子邮件所花费的时间。

我需要以分:秒的格式显示它。

这是聪明的一面

<div class="clientssummarybox">
<div class="title">{$_ADMINLANG.clientsummary.emailsheading}</div>
<table class="clientssummarystats" cellspacing="0" cellpadding="2">
{foreach key=num from=$lastfivemail item=email}
<tr class="{cycle values=",altrow"}"><td align="center">{$email.date} - <a href="#" onClick="window.open('clientsemails.php?&displaymessage=true&id={$email.id}','','width=650,height=400,scrollbars=yes');return false">{$email.subject}</a></td><td>{$email.processtime}</td></tr>
{foreachelse}
<tr><td align="center">{$_ADMINLANG.clientsummary.noemails}</td></tr>
{/foreach}
</table>
</div>

</td><td width="25%" valign="top">

谢谢

最佳答案

使用 Smarty 2 及更高版本你可以使用

{$email.processtime|date_format:'%H:%M:%S'}

See reference here

关于php - 秒到分钟 :seconds from mysql to smarty,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19135673/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com