ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:datetime:adodb_date

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
datetime:adodb_date [2015/11/26 15:18] mnewnhamv5:datetime:adodb_date [2023/05/18 18:55] (current) – Deprecated dregad
Line 5: Line 5:
 [[http://php.net/manual/en/function.date.php|PHP Function date()]] [[http://php.net/manual/en/function.date.php|PHP Function date()]]
 == Syntax == == Syntax ==
-  int adodb_date(+  string adodb_date(
       string $format,       string $format,
       optional mixed $timestamp = false       optional mixed $timestamp = false
   )   )
 </WRAP> </WRAP>
 +
 +<WRAP important>
 +[[datetime_index#deprecated|Deprecated]] since ADOdb 5.22.6, and [[https://github.com/ADOdb/ADOdb/issues/970|removed in 5.23.0]].
 +Use 64-bit native PHP functions instead.
 +</WRAP>
 +
 ===== Description ===== ===== Description =====
  
-This function converts a timestamp to a formatted local date. If ''$timestamp'' is not defined, the current timestamp is used. Unlike the function date(), it supports dates outside the 1901 to 2038 range.+This function converts a timestamp to a formatted local date. If ''$timestamp'' is not defined, the current timestamp is used. Unlike the function date(), it supports dates outside the 1901 to 2038 range. To produce a date prior to the epoch date, a negative number of seconds prior to that number can be provided 
 +------------------------------------- 
 +===== Usage ====== 
 +<code php> 
 +print adodb_date('d/m/Y'); 
 +/* 
 +* Prints 03/12/2015 
 +*/ 
 + 
 +print adodb_date('d/m/Y',0); 
 +/* 
 +* Prints 12/31/1969 
 +*/
  
--------------------------------+print adodb_date('d/m/Y', -27454896000); 
 +/* 
 +* Prints 12/21/1099 
 +*/ 
 +</code> 
 +===== Available Formats =====
 The format fields that adodb_date supports: The format fields that adodb_date supports:
  
v5/datetime/adodb_date.1448547503.txt.gz · Last modified: 2017/04/21 11:27 (external edit)