11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 12 • DATE AND TIMEwww.it-ebooks.infoParameter DescriptionExamplel Text representation of day Monday through SundayL Leap year 0 if no, 1 if yesm Numeric representation of month, with zeros 01 through 12M Three-letter text representation of month Jan through DecnNumeric representation of month, withoutzeros1 through 12O Difference to Greenwich Mean Time (GMT) –0500r Date formatted according to RFC 2822 Tue, 19 Apr 2010 22:37:00 –0500S Seconds, with zeros 00 through 59S Ordinal suffix of day st, nd, rd, tht Total number of days in month 28 through 31T Time zone PST, MST, CST, EST, etc.U Seconds since Unix epoch (timestamp) 1172347916w Numeric representation of weekday 0 for Sunday through 6 for SaturdayW ISO 8601 week number of year 1 through 52 or 1 through 53, depending onthe day in which the week ends. See ISO 8601standard for more information.Y Four-digit representation of year 1901 through 2038z Day of year 0 through 364Z Time zone offset in seconds –43200 through 50400Despite having regularly used <strong>PHP</strong> for years, many <strong>PHP</strong> programmers still need to visit thedocumentation to refresh their memory about the list of parameters provided in Table 12-1. Therefore,although you won’t necessarily be able to remember how to use this function simply by reviewing a fewexamples, let’s look at the examples just to give you a clearer understanding of what exactly date() iscapable of accomplishing.The first example demonstrates one of the most commonplace uses for date(), which is simply tooutput a standard date to the browser:272

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!