Answer the question
In order to leave comments, you need to log in
Why, if you use templating, then the logic starts to work not as it should?
Tell me what could be the problem... If you do not use templating, but simply compose the elements of the image list, then everything works fine, but if you use a templating engine, it does not work as it should, for some reason the shift coordinates are calculated in the opposite direction.
Working version without templating - https://codepen.io/evg_/pen/JJgpOB?editors=1010
Non-working version with templating - https://codepen.io/evg_/pen/dWvEdq?editors=1010
Answer the question
In order to leave comments, you need to log in
echo 'Timestamp: '.strtotime('2019-02-06T18:00:00+03:00');
echo 'Текущий timestamp: '.time();
echo 'Разница, секунд: '. (time() - strtotime('2019-02-06T18:00:00+03:00'));
DateTime
php.net/manual/ru/class.datetime.php
and it has an interval function
php.net/manual/ru/class.dateinterval.php
$d1=new DateTime("2012-07-08 11:14:15.638276");
$d2=new DateTime("2012-07-08 11:14:15.889342");
$diff=$d2->diff($d1);
print_r($diff);
Check the value of the listItems property, which is set before initialization and participates in the calculations.
Corrected version: https://codepen.io/lmoroz/pen/MoNBZZ?editors=1011#0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question