Click here to Skip to main content
11,496,146 members (800 online)
Click here to Skip to main content

Tagged as

Timezones in PHP

, 5 Aug 2008 CPOL 17.3K 421 6
List of all timezones in PHP.
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.



In PHP 5, there are some methods to set or get the default timezone. For example, using this code, I set the default timezone used by all date/time functions:

    date_default_timezone_set("Asia/Tehran"); //I set timezone for Tehran

In another example, I set the default timezone for Tokyo:


There are many lists of timezones in the PHP manual (for more info about date_default_timezone_set, see here). I just got them into the menu list in HTML.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Mohammad Dayyan

Iran (Islamic Republic Of) Iran (Islamic Republic Of)
No Biography provided

Comments and Discussions

GeneralMy vote of 1 Pin
stankomix121-Dec-11 0:56
memberstankomix121-Dec-11 0:56 
Questiongreat Pin
headspring16-Sep-11 22:54
memberheadspring16-Sep-11 22:54 
AnswerRe: great Pin
Mohammad Dayyan18-Sep-11 10:35
memberMohammad Dayyan18-Sep-11 10:35 
GeneralRe: great Pin
S.M. Zamshed Farhan11-Jan-13 6:49
memberS.M. Zamshed Farhan11-Jan-13 6:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150520.1 | Last Updated 5 Aug 2008
Article Copyright 2008 by Mohammad Dayyan
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid