ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:datetime:adodb_getdate

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
datetime:adodb_getdate [2015/11/26 15:06] mnewnhamv5:datetime:adodb_getdate [2016/05/01 03:31] mnewnham
Line 3: Line 3:
 <WRAP right box> <WRAP right box>
 == See Also == == See Also ==
-[[http://php.net/manual/en/function.get.php|PHP Function getdate()]]+[[http://php.net/manual/en/function.getdate.php|PHP Function getdate()]]
 == Syntax == == Syntax ==
-  int adodb_getdate( +  array adodb_getdate( 
-     optional mixed $date=false+     optional mixed $timestamp=time()
   )   )
 </WRAP> </WRAP>
 ===== Description ===== ===== Description =====
-Returns an array containing date information, as getdate(), but supports dates greater than 1901 to 2038. The local date/time format is derived from a heuristic the first time adodb_getdate is called..  +Returns an array containing date information, the same as the PHP function ''getDate()'', but supporting dates less than 1901 and greater than 2038. The local date/time format is derived from a heuristic the first time adodb_getdate() is called. 
 + 
 +-------------------------------- 
 +===== Usage ===== 
 +<code php> 
 + 
 +/* 
 +* Gets information from now 
 +*/ 
 + 
 +$d = adodb_getdate(); 
 + 
 +print_r($d); 
 + 
 +/* 
 +* Returns  
 +Array 
 +
 +    [seconds] => 28 
 +    [minutes] => 51 
 +    [hours] => 14 
 +    [mday] => 3 
 +    [wday] => 4 
 +    [mon] => 12 
 +    [year] => 2015 
 +    [yday] => 336 
 +    [weekday] => Thursday 
 +    [month] => December 
 +    [0] => 1449179488 
 +
 +*/ 
 + 
 +/* 
 +* What happened a thousand years ago? 
 +*/ 
 +$d = adodb_getdate(time() - (365 * 24 * 60 * 60 * 1000)); 
 +/* 
 +* Returns  
 +Array 
 +
 +    [seconds] => 46 
 +    [minutes] => 54 
 +    [hours] => 14 
 +    [mday] => 27 
 +    [wday] => 2 
 +    [mon] => 7 
 +    [year] => 1016 
 +    [yday] => 208 
 +    [weekday] => Tuesday 
 +    [month] => July 
 +    [0] => -30086820314 
 +
 +*/ 
 +</code> 
 + 
 +Note that in the example above, the number of seconds in array index 0, is negative. This is because we are setting a date prior to the epoch value of 0 at 01/01/1970. 
v5/datetime/adodb_getdate.txt · Last modified: 2023/05/18 18:54 by dregad