PHP date_default_timezone_get() Function
In this chapter you will learn:
- Definition for PHP date_default_timezone_get() Function
- Syntax for PHP date_default_timezone_get() Function
- Return for PHP date_default_timezone_get() Function
- Example - Return the default timezone:
Definition
The date_default_timezone_get() function returns the default timezone used by date/time functions.
Syntax
PHP date_default_timezone_get() Function has the following syntax.
date_default_timezone_get();
Return
PHP date_default_timezone_get() Function returns the timezone as a string.
Example
Return the default timezone:
<?php
echo date_default_timezone_get();
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP date_default_timezone_set() Function
- Syntax for PHP date_default_timezone_set() Function
- Parameter for PHP date_default_timezone_set() Function
- Return for PHP date_default_timezone_set() Function
- Example - Set the default timezone
Home » PHP Tutorial » PHP Date Functions