php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36818 time() returns UTC time instead of local time
Submitted: 2006-03-22 04:05 UTC Modified: 2006-03-22 13:17 UTC
From: liber at iproom dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.1.2 OS: Windows XP
Private report: No CVE-ID: None
 [2006-03-22 04:05 UTC] liber at iproom dot com
Description:
------------
time()

On Windows XP:
it will shows UTC time.

On Linux:
it will shows local time correctly.

Reproduce code:
---------------
echo date("Y-m-d H:i:s",time());

Expected result:
----------------
return local time

Actual result:
--------------
return UTC time

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-22 04:24 UTC] liber at iproom dot com
can use date_default_timezone_set() to solve this problem.
 [2006-03-22 13:17 UTC] bjori@php.net
no bug -> bogus
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Dec 05 00:00:01 2025 UTC