The script makes the calculation time can certainly be made in various ways. Usually advanced programmers will create a PHP script with a very brief way. why? One reason is that they create a PHP script more efficient. The more short PHP script, it looks more sophisticated and increasingly confusing us newbie.
Here we will take a look step by step.
The trick is by following three easy steps:
1. The principle is used to change the timestamp server using the function $ timestamp = strtotime ($ cur).
Well, the contents of the variable $ timestamp that is the number of seconds since January 1, 1970.
2. If so, add $ timestamp with the desired number of seconds (in this case is 60 seconds. So, add the following line of code: $ timestamp = $ timestamp +60.
3. If it is returned to the timestamp figures we know the date format in general with date function.
So, the whole code would be:
PHP Code:
<?
$timestamp=strtotime($skr);
$timestamp=$timestamp+60;
date("m/d/Y H:i:s",$timestamp);
?>
There is another way shorter (and perhaps a bit confusing for those who are just learning) like this example:
<?
$timestamp = date('U');
$skr = date('m/d/Y H:i:s', $timestamp);
$nanti = date('m/d/Y H:i:s', $timestamp+60);
?>
Sign up here with your email