v5:reference:connection:offsetdate
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
v5:reference:connection:offsetdate [2025/08/19 17:24] – [offsetDate] mnewnham | v5:reference:connection:offsetdate [2025/08/20 05:04] (current) – mnewnham | ||
---|---|---|---|
Line 5: | Line 5: | ||
string|bool ADOConnection:: | string|bool ADOConnection:: | ||
| | ||
- | | + | |
) | ) | ||
</ | </ | ||
+ | |||
+ | ==== Note ==== | ||
+ | Passing a decimal offset less than one without | ||
+ | specifying a base date will always return the | ||
+ | current date because the calculation time | ||
+ | basis is always the beginning of the current date | ||
+ | |||
===== Description ===== | ===== Description ===== | ||
- | The function '' | + | The function '' |
The function returns the SQL string that performs the calculation when passed to '' | The function returns the SQL string that performs the calculation when passed to '' | ||
Line 19: | Line 26: | ||
* As a decimal indicating the number of days where the decimal portion is the fraction of a day (e.g. 0.5 = 12 hours) | * As a decimal indicating the number of days where the decimal portion is the fraction of a day (e.g. 0.5 = 12 hours) | ||
* As string in the format " | * As string in the format " | ||
+ | |||
+ | The $isoDate can be: | ||
+ | * A basis date in ISO format including a time portion, if a fractional calculation is required | ||
+ | * An SQL statement that produces an ISO date | ||
+ | * An SQL column if the method is to be used to calculate date offsets based on table values | ||
+ | * skipped or false for today | ||
+ | |||
===== Example ===== | ===== Example ===== | ||
In Oracle, to find the date and time that is 2.5 days from today, you can use: | In Oracle, to find the date and time that is 2.5 days from today, you can use: | ||
Line 55: | Line 69: | ||
*/ | */ | ||
+ | </ | ||
+ | |||
+ | ===== Example Generating A Date From a column Value ==== | ||
+ | In this example we would use the statement to return a date 7 days forward from the current value of the column " | ||
+ | |||
+ | <code php> | ||
+ | |||
+ | $newDeliveryDate = $db-> | ||
+ | |||
+ | $SQL = " | ||
+ | FROM delivery_master | ||
+ | WHERE delivery_date = {$db-> | ||
+ | |||
</ | </ | ||
v5/reference/connection/offsetdate.1755617040.txt.gz · Last modified: by mnewnham