ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:datetime:adodb_last_date_status

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
v5:datetime:adodb_last_date_status [2019/01/02 03:31] – created mnewnhamv5:datetime:adodb_last_date_status [2019/01/02 03:37] mnewnham
Line 44: Line 44:
 ) )
  
-This is clearly the wrong answer, because the ADODB_FUTURE_DATE_CUTOFF_YEARS has constrained the maximum forward date. Let's check the status +This is clearly the wrong answer, because the ADODB_FUTURE_DATE_CUTOFF_YEARS  
 +has constrained the maximum forward date. Let's check the status 
 */ */
 $status = adodb_last_date_status(); $status = adodb_last_date_status();
Line 50: Line 51:
 /* /*
 * Returns 1 (the function indicates that the last conversion failed * Returns 1 (the function indicates that the last conversion failed
 +*/
 +</code>
 +
 +
 +If we modify the constant before including the adodb includes, we can run it again
 +<code php>
 +DEFINE('ADODB_FUTURE_DATE_CUTOFF_YEARS',1000);
 +include 'adodb.inc.php';
 +$s = time() +(60*60*24*365 * 500);
 +/*
 +* Call the function
 +*/
 +$time = adodb_getdate($s);
 +
 +print_r($time);
 +
 +/*
 +Array
 +(
 +    [seconds] => 49
 +    [minutes] => 35
 +    [hours] => 2
 +    [mday] => 3
 +    [wday] => 6
 +    [mon] => 9
 +    [year] => 2518
 +    [yday] => 245
 +    [weekday] => Saturday
 +    [month] => September
 +    [0] => 17314396549
 +)
 */ */
 </code> </code>
  
v5/datetime/adodb_last_date_status.txt · Last modified: 2023/05/18 18:53 by dregad