Sumit Sharma wrote:

What I mean is my windows time is set to local time but when I use any date
function in PHP it shows time in GMT on web browser and to change this I
have to use putenv("TZ=asia/calcutta");


1 There is no problem with Windows time its according to IST.
2 Problem start with PHP, which displays GMT time by default.
3 To solve this I was advised to change the OS time which is already

Now I am not aware how the php date functions picking GMT time and from

Basic time is always UTC ( GMT is the same ) and so unless you TELL it otherwise, PHP displays UTC. That way if you have clients accessing from different time zones they get a consistent time.

If you want to display a particular time zone for a client, then you need to know what timezone that client is in, which is where "TZ=asia/calcutta" sets it globally for your site. Windows does not provide sufficient data to identify the timezone and so PHP defaults to it not being set. covers the date functions that were added in PHP5.1, and which replace the earlier methods since they actually handle daylight saving as well, something that TZ and the earlier browser based time zone information simply ignores ...

Lester Caine - G8HFL
Contact -
L.S.Caine Electronic Services -
EnquirySolve -
Model Engineers Digital Workshop -
Firebird -

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to