English 中文(简体)
Ph第二步至最接近的季度小时
原标题:Php Counting seconds to the nearest quarter-hour

我提出这样的申请,需要时间,直到事件(第二次)显示计票时间。 计时计时器应当缩短20分钟。 然而,我需要利用php来找到下三个小时(12:00、12:20、12:40等)的秒钟,而我不认为这样做符合逻辑。

没有人提出建议?

最佳回答
echo $remaining = 15-(date( i , time()) % 15);

http://www.un.org/Depts/DGACM/index_french.htm 那么,正如你想要看到今后15岁之前有多少人,15-x是你的答复。

  • So 18:41 is 41 minutes past the hour.
  • 41%15 gives a remainder of 11.
  • 15-11 gives you 4 meaning there are 4 minutes until the next 15 minute interval.

如果你需要三分之二的时间,而不是一小时的季度,则明显改变15至20年......

问题回答

你们可以问一下,什么时候了,只回过几分钟。 你在职能日期(日期)上这样做。 然后,你简单地发挥职能(我写成一种功能,但你也可以把它作为正常的连续地点,而没有职能和回报。) 从你想要到的几分钟中,我们用几分钟时间发言。

与此类似:

<?php
function get_the_seconds() { //


$minutes = date( i ); //how many minutes in the hour are we

   if ($minutes <= 20) {
       $seconds = (20-$minutes)*60; //60 secs in a minute :)
   } elseif ($minutes >= 20 && $minutes <= 40) {
       $seconds = (40-$minutes)*60;
   } else {
       $seconds = (60-$minutes)*60;
   }
   return $seconds 
}
?>




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签