v5:datetime:adodb_date2
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| datetime:adodb_date2 [2015/11/26 15:24] – mnewnham | v5:datetime:adodb_date2 [2023/05/18 18:54] (current) – Deprecated dregad | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| <WRAP right box> | <WRAP right box> | ||
| == See Also == | == See Also == | ||
| - | [[datetime: | + | [[v5:datetime: | 
| == Syntax == | == Syntax == | ||
| string adodb_date2( | string adodb_date2( | ||
| Line 10: | Line 10: | ||
| ) | ) | ||
| </ | </ | ||
| + | |||
| + | <WRAP important> | ||
| + | [[datetime_index# | ||
| + | Use 64-bit native PHP functions instead. | ||
| + | </ | ||
| + | |||
| ===== Description ===== | ===== Description ===== | ||
| - | This function extends the adodb_date() function, allowing the second argument to be passed as an ISO format string instead of a timestamp. | + | This function extends the adodb_date() function, allowing the second argument to be passed as an ISO format string instead of a timestamp. This makes it easier to generate formatted times outside of the normal unix timestamp range. | 
| ---------------------------------- | ---------------------------------- | ||
| ===== Usage ===== | ===== Usage ===== | ||
| Line 17: | Line 23: | ||
| $d = adodb_date2(' | $d = adodb_date2(' | ||
| </ | </ | ||
| + | ===== Note ===== | ||
| + | |||
| + | To make the calculation work correctly for early years, it is important to use 4 digit years for the '' | ||
| + | ----------------------------------------------- | ||
| + | <code php> | ||
| + | /* | ||
| + | * Correct usage | ||
| + | */ | ||
| + | $date = adodb_date(' | ||
| + | /* | ||
| + | * Returns 12/25/900 | ||
| + | */ | ||
| + | |||
| + | /* | ||
| + | * Incorrect usage | ||
| + | */ | ||
| + | $date = adodb_date(' | ||
| + | /* | ||
| + | * Returns 12/03/2015 (todays date) | ||
| + | */ | ||
| + | </ | ||
| + | |||
v5/datetime/adodb_date2.1448547899.txt.gz · Last modified:  (external edit)
                
                