Join Kevin Skoglund for an in-depth discussion in this video Set default in php.ini, part of Easy PHP Projects: Time Zone Conversion.
- [Voiceover] In this movie, we'll learn…how to set the default timezone…in the php.ini file.…This is the best way for you to set…the default timezone in php.…When php first launches,…it's going to see our default value…and use it from then on.…It's important to have the default timezone set…before you use any of php's date functions.…If you're still using version five of php,…you're going to actually see a nasty warning…if you don't do it.…That's not true in later versions,…but in version five it is very much true.…
Let me demonstrate.…I'm just going to open up this my_phpinfo.php page…and for now, I'm just going to comment this line out.…I don't want it to actually do that.…Instead I'm just going to do a quick demonstration,…you don't need to follow along with me.…You can just observe,…and I'm just going to tell the date function…that it ought to output the current date.…That's what that's going to do.…So I'm going to save that…and then let's just hope over here to Firefox,…and let's reload this page here.…Now you'll see that it says 2016.…
- Understanding the history and purpose of time zones
- Setting a default time zone in PHP
- Using the PHP DateTime and DateTimeZone classes
- Working with daylight saving time transitions
- Allowing users to select their time zone
- Displaying times in the user's preferred time zone
- Calculating the current times of major cities
- Creating a complete time zone calculator
Skill Level Beginner
1. About Time Zones
2. Default Time Zone
3. Working with Time Zones in PHP
4. User Time Zone Selection
5. Respect the User's Time Zone
6. Current World Times
7. Time Zone Calculator
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.