How to use date default timezone set in PHP

This article describe about date_default_timezone_set() Function in PHP.
  • 2311

date_default_timezone_set() Function

This set the default timezone used by date/time fucnction.

Syntax

date_default_timezone_set(timezone)

 

Parameter Description
timezone timezone identifier Required like "UTC" or Europe/paris etc.

Note: This function return true if timezone identifier is valid otherwise false.

Example

<html>
<body>
<?php
echo(date_default_timezone_set("UTC"));
?>
</body>
</html>

 

Output


pic3.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.