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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: liber at iproom dot com
New email:
PHP Version: OS:

 

 [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-2026 The PHP Group
All rights reserved.
Last updated: Tue May 26 15:00:02 2026 UTC