PHP düşük saat UNIX zaman aşağı yuvarlama

0 Cevap php

Ben PHP alt saat şimdiki zaman aşağı yuvarlamak için boşuna çalışıyorlar.

Here's what I want to do: 1. Take the current time: $time_now = time(); 2. Round it down to the closest hour: $time_now = $time_now - ($time_now % 3600); 3. Print it using the function date: print date('d m Y H:i', $time_test);

But what seems to be happening is that the printed time is what I want + 30 minutes. e.g: If current time is 19:03, I get an output of 18:30 instead of 19:00 and if the time is 19:34, I get an output of 19:30 instead of 19:00

This driving me crazy! X( What seems to be wrong in this code?! Something to do with the timezone perhaps? My system time is GMT +5:30

0 Cevap