Php current timestamp
- php show current time
- php show current timezone
- php get current timestamp
- php get current timezone
Php date
Php date format!
How to Get the Current Date and Time in PHP
Topic: PHP / MySQLPrev|Next
Answer: Use the PHP Function
You can simply use the PHP function to get the current data and time in various format, for example, , , and so on.
Try out the following example to see how it basically works:
Example
Try this code »The date and time returned by the above example is based on the server's default timezone setting.
If you want to show date and time as per user's timezone, you can set the timezone manually using the function before the function call.
The following example shows the date and time in India timezone which is .
Example
Try this code »To learn more about date and time handling, please check out the PHP date and time tutorial.
For a complete list of timezones supported by PHP, see timezone reference.
Related FAQ
Here are some more FAQ related to this topic:
Previous PageNext Page
- php get current time in milliseconds
- php get current timezone offset