/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Outputs the date as a string given the format strFormat. By default, * it will return as QDateTime::FormatDisplayDate "MMM DD YYYY", e.g. Mar 20 1977. * * Properties of strFormat are (using Sunday, March 2, 1977 at 1:15:35 pm * in the following examples): * * M - Month as an integer (e.g., 3) * MM - Month as an integer with leading zero (e.g., 03) * MMM - Month as three-letters (e.g., Mar) * MMMM - Month as full name (e.g., March) * * D - Day as an integer (e.g., 2) * DD - Day as an integer with leading zero (e.g., 02) * DDD - Day of week as three-letters (e.g., Wed) * DDDD - Day of week as full name (e.g., Wednesday) * * YY - Year as a two-digit integer (e.g., 77) * YYYY - Year as a four-digit integer (e.g., 1977) * * h - Hour as an integer in 12-hour format (e.g., 1) * hh - Hour as an integer in 12-hour format with leading zero (e.g., 01) * hhh - Hour as an integer in 24-hour format (e.g., 13) * hhhh - Hour as an integer in 24-hour format with leading zero (e.g., 13) * * mm - Minute as a two-digit integer * * ss - Second as a two-digit integer * * z - "pm" or "am" * zz - "PM" or "AM" * zzz - "p.m." or "a.m." * zzzz - "P.M." or "A.M." * * ttt - Timezone as a three-letter code (e.g. GMT) * * @param string $strFormat the format of the date * @return string the formatted date as a string */