v5:datetime:adodb_date
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
datetime:adodb_date [2015/11/26 15:09] – created mnewnham | v5:datetime:adodb_date [2016/01/13 02:12] – ↷ Page moved from datetime:adodb_date to v5:datetime:adodb_date mnewnham | ||
---|---|---|---|
Line 3: | Line 3: | ||
<WRAP right box> | <WRAP right box> | ||
== See Also == | == See Also == | ||
- | [[http:// | + | [[http:// |
== Syntax == | == Syntax == | ||
- | | + | |
+ | string $format, | ||
+ | optional mixed $timestamp = false | ||
+ | | ||
</ | </ | ||
===== Description ===== | ===== Description ===== | ||
+ | This function converts a timestamp to a formatted local date. If '' | ||
+ | ------------------------------------- | ||
+ | ===== Usage ====== | ||
+ | <code php> | ||
+ | print adodb_date(' | ||
+ | /* | ||
+ | * Prints 03/12/2015 | ||
+ | */ | ||
- | Convert a timestamp to a formatted local date. If $timestamp is not defined, the current timestamp is used. Unlike the function date(), it supports dates outside the 1901 to 2038 range.The format fields that adodb_date supports: | + | print adodb_date(' |
- | a - " | + | /* |
- | A - " | + | * Prints 12/ |
- | d - day of the month, 2 digits with leading zeros; i.e. " | + | */ |
- | D - day of the week, textual, 3 letters; e.g. " | + | |
- | F - month, textual, long; e.g. " | + | print adodb_date(' |
- | g - hour, 12-hour format without leading zeros; i.e. " | + | /* |
- | G - hour, 24-hour format without leading zeros; i.e. " | + | * Prints 12/ |
- | h - hour, 12-hour format; i.e. " | + | */ |
- | H - hour, 24-hour format; i.e. " | + | </ |
- | i - minutes; i.e. " | + | ===== Available Formats ===== |
- | j - day of the month without leading zeros; i.e. " | + | The format fields that adodb_date supports: |
- | l (lowercase ' | + | |
- | L - boolean for whether it is a leap year; i.e. " | + | |
- | m - month; i.e. " | + | A - " |
- | M - month, textual, 3 letters; e.g. " | + | d - day of the month, 2 digits with leading zeros; i.e. " |
- | n - month without leading zeros; i.e. " | + | D - day of the week, textual, 3 letters; e.g. " |
- | O - Difference to Greenwich time in hours; e.g. " | + | F - month, textual, long; e.g. " |
- | Q - Quarter, as in 1, 2, 3, 4 | + | g - hour, 12-hour format without leading zeros; i.e. " |
- | r - RFC 2822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200" | + | G - hour, 24-hour format without leading zeros; i.e. " |
- | s - seconds; i.e. " | + | h - hour, 12-hour format; i.e. " |
- | S - English ordinal suffix for the day of the month, 2 characters; | + | H - hour, 24-hour format; i.e. " |
- | i.e. " | + | i - minutes; i.e. " |
- | t - number of days in the given month; i.e. " | + | j - day of the month without leading zeros; i.e. " |
- | T - Timezone setting of this machine; e.g. " | + | l - (lowercase ' |
- | U - seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) | + | L - boolean for whether it is a leap year; i.e. " |
- | w - day of the week, numeric, i.e. " | + | m - month; i.e. " |
- | Y - year, 4 digits; e.g. " | + | M - month, textual, 3 letters; e.g. " |
- | y - year, 2 digits; e.g. " | + | n - month without leading zeros; i.e. " |
- | z - day of the year; i.e. " | + | O - Difference to Greenwich time in hours; e.g. " |
- | Z - timezone offset in seconds (i.e. " | + | Q - Quarter, as in 1, 2, 3, 4 |
- | The offset for timezones west of UTC is always negative, | + | r - RFC 2822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200" |
- | and for those east of UTC is always positive. | + | s - seconds; i.e. " |
- | Unsupported: | + | S - English ordinal suffix for the day of the month, |
- | B - Swatch Internet time | + | |
- | I (capital i) - " | + | t - number of days in the given month; i.e. " |
- | W - ISO-8601 week number of year, weeks starting on Monday | + | T - Timezone setting of this machine; e.g. " |
+ | U - seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) | ||
+ | w - day of the week, numeric, i.e. " | ||
+ | Y - year, 4 digits; e.g. " | ||
+ | y - year, 2 digits; e.g. " | ||
+ | z - day of the year; i.e. " | ||
+ | Z - timezone offset in seconds (i.e. " | ||
+ | The offset for timezones west of UTC is always negative, | ||
+ | and for those east of UTC is always positive. | ||
+ | |||
+ | The following formats are unsupported: | ||
+ | |||
+ | | ||
+ | I - (capital i) - " | ||
+ | W - ISO-8601 week number of year, weeks starting on Monday | ||
+ | |||
+ | |
v5/datetime/adodb_date.txt · Last modified: 2023/05/18 18:55 by dregad