Using GMT DateTime Information


Using GMT Date/Time Information

Usually, PHP takes the local settings for time formats. However in some special cases, the GMT time format must be used. For this, PHP offers "GMT-enabled" versions of some of its date/time functions:

  • gmdate() works like date() and formats a date/time value; however, the return value uses GMT format

  • gmmktime() creates a time stamp like mktime(); however, it uses GMT

  • gmstrftime() formats a time as strftime() does; however, it uses GMT

GMT is important when it comes to setting a page's expiry date in an HTTP header or manually setting the expiry date of a cookie, also in the HTTP header.

What Does PEAR Offer?

The following PEAR packages offer functionality helpful for processing form data of any kind:

  • Date contains a set of functions to work with various date/time values, including conversions between time zones and various date/time representations

  • Date_Holidays calculates the names and dates of special holidays





PHP Phrasebook
PHP Phrasebook
ISBN: 0672328178
EAN: 2147483647
Year: 2005
Pages: 193

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net