v5:datetime:custom_dst
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
v5:datetime:custom_dst [2016/04/15 03:23] – mnewnham | v5:datetime:custom_dst [2023/05/18 18:51] (current) – Deprecated dregad | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Daylight Savings Time ====== | ||
+ | ~~NOTOC~~ | ||
+ | <WRAP right box> | ||
+ | == Syntax == | ||
+ | void adodb_daylight_sv( | ||
+ | array & | ||
+ | bool $isGmt | ||
+ | ) | ||
+ | </ | ||
+ | |||
+ | <WRAP important> | ||
+ | [[datetime_index# | ||
+ | Use 64-bit native PHP functions instead. | ||
+ | </ | ||
+ | | ||
+ | Currently, the ADOdb date/time library has no built-in support for Daylight Savings Time, but provides a simple hook that allows you to define your own daylights savings function. The function must be called // | ||
+ | ------------------------- | ||
+ | ===== Usage ===== | ||
+ | In this example, we apply daylights savings in June or July, adding one hour. This is extremely unrealistic as it does not take into account time-zone, geographic location, current year. | ||
+ | |||
+ | <code php> | ||
+ | function adodb_daylight_sv(& | ||
+ | { | ||
+ | if ($isGmt) | ||
+ | return; | ||
+ | $m = $dateStructure[' | ||
+ | if ($m == 6 || $m == 7) | ||
+ | $dateStructure[' | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | This is only called by adodb_date() and not by adodb_mktime(). | ||
+ | |||
===== The Date Structure ===== | ===== The Date Structure ===== | ||
The format of $dateStructure is | The format of $dateStructure is |
v5/datetime/custom_dst.1460683413.txt.gz · Last modified: 2017/04/21 11:26 (external edit)