Penggunaan php datetime::modify

CodeIgniter provides a fully-localized, immutable, date/time class that is built on PHP’s DateTime object, but uses the Intl extension’s features to convert times across timezones and display the output correctly for different locales. This class is the Time class and lives in the CodeIgniter\I18n namespace.

Note

Since the Time class extends DateTime, if there are features that you need that this class doesn’t provide, you can likely find them within the DateTime class itself.

Instantiating

There are several ways that a new Time instance can be created. The first is simply to create a new instance like any other class. When you do it this way, you can pass in a string representing the desired time. This can be any string that PHP’s strtotime function can parse:

Bài mới nhất

Chủ Đề