Click here to Skip to main content
Licence CPOL
First Posted 5 Aug 2008
Views 10,102
Downloads 147
Bookmarked 4 times

Timezones in PHP

By | 5 Aug 2008 | Article
List of all timezones in PHP.

TimeZoneList.jpg

Introduction

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:

<?php
    date_default_timezone_set("Asia/Tehran"); //I set timezone for Tehran
?>

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

<?php
    date_default_timezone_set("Asia/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.

License

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)

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 1 Pinmemberstankomix123:56 20 Dec '11  
Questiongreat Pinmemberheadspring21:54 16 Sep '11  
AnswerRe: great PinmemberMohammad Dayyan9:35 18 Sep '11  

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.

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