Using the Current Date the U.S.U.K.European Way


Using the Current Date the U.S./U.K./European Way

 <?php   echo 'US format: ' . date('m/d/Y<b\r />');   echo 'UK format: ' . date('d/m/Y<b\r />');   echo 'German format: ' . date('d.m.Y<b\r />');   echo 'International format: ' . date('Y-d-m'); ?> 


To give you a short and convenient reference, the preceding code contains several commonly used date formats. Depending on where you are, the order in which day, month, and year are used might vary:

  • In the United States, it's (mostly) month, day, and year

  • In the United Kingdom and the rest of Europe, it's (mostly) day, month, and year

  • The international standard date notation starts with the year and continues with month and day

NOTE

The preceding code used a four-digit representation of the year because this is nonambiguous. In practice, however, two-digit years are also commonly used.





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