prefix."amazoncache WHERE U-6ren">
gpt4 book ai didi

php - MySQL now() 和更新时间之间的时间差

转载 作者:行者123 更新时间:2023-11-29 14:10:19 25 4
gpt4 key购买 nike

我的代码如下

$checksql= "SELECT Body, ( NOW() - Updated ) as Age FROM ".$wpdb->prefix."amazoncache WHERE URL = '" . $keyurl . "' AND NOT( Body LIKE '%AccountLimitExceeded%') AND NOT( Body LIKE '%SignatureDoesNotMatch%') AND NOT( Body LIKE '%InvalidParameterValue%');";
$result = $wpdb->get_results($checksql);

if (count($result) > 0){
if ($result[0]->Age <= 6001 && $result[0]->Body != ''){ //that would be 60 min 1 seconds on MYSQL value
$pxml = GetXMLTree($result[0]->Body);
return $pxml;
}}

我想将值 6001 更改为 1 周。谁能告诉我如何计算1周、2周和1个月的值(value)

最佳答案

就像这样..

$var = 3601; // (60 * 60) + 1
$oneWeek = $var+strtotime("+1 week");
$twoWeek = $var+strtotime("+2 week");
$oneMonth = $var+strtotime("+1 month");

我在球场上吗?

关于php - MySQL now() 和更新时间之间的时间差,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13580824/

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