Sumit Sharma wrote:
Hi,

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");

Thus:

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
changed.

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

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.

http://us2.php.net/manual/en/book.datetime.php 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 - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to