v5:datetime:custom_dst
This is an old revision of the document!
Daylight Savings Time
Allow you to define your own daylights savings function, adodb_daylight_sv. If the function is defined (somewhere in an include), then you can correct for daylights savings.
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.
function adodb_daylight_sv(&$arr, $is_gmt) { if ($is_gmt) return; $m = $arr['mon']; if ($m == 6 || $m == 7) $arr['hours'] += 1; }
This is only called by adodb_date() and not by adodb_mktime().
The format of $arr is
Array ( [seconds] => 0 [minutes] => 0 [hours] => 0 [mday] => 1 # day of month, eg 1st day of the month [mon] => 2 # month (eg. Feb) [year] => 2102 [yday] => 31 # days in current year [leap] => # true if leap year [ndays] => 28 # no of days in current month )
v5/datetime/custom_dst.1460590659.txt.gz · Last modified: 2017/04/21 11:26 (external edit)