Page 1 of 1

i need code for current date and time?

Posted: Thu Nov 09, 2006 9:22 am
by qumar
hi,

i need code for current date and time. I am trying this following code.

$datetime=date("d/m/y H:i:s");

But i am getting date is correctly. But time gives GTM time, means less 5.30h.
so please help to me.
Thanks.

Posted: Thu Nov 09, 2006 10:22 am
by Mordred
Try

Code: Select all

gmdate()
But it should be the other way around, gmdate() gives GMT time and date() gives local time.

Posted: Thu Nov 09, 2006 1:39 pm
by feyd
The local server time may be set to GMT. I always set my servers to UTC.