Join Kevin Skoglund for an in-depth discussion in this video Set default at runtime, part of Easy PHP Projects: Time Zone Conversion.
- [Voiceover] In this movie we will learn how to set…the default timezone at runtime.…In the previous movie we saw how to set the default timezone…in the php.ini configuration file.…Overall, that's still the best place to set it.…However, that option isn't always available to us…or it may not fit our needs.…It's often the case you may not have access…to edit the php.ini file.…This is especially true if you're hosting your scripts…on someone else's server.…Often, the php.ini file is set by them…and they don't want you to change it…and a lot of times that's because many different users…on the same server are using PHP.…
So you can't configure it just for your personal use.…Or it may be that you have access to php.ini…but you want to use a different default in certain cases.…Like for a certain PHP script.…Imagine that most of your users are in a single time zone…but then you need to create a PHP application…that it's intended to support a group of your company…that's in a different time zone.…Maybe they're on the other side of the world,…
- 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.