TYPO3 CMS  TYPO3_7-6
adodb-time.inc.php File Reference

Go to the source code of this file.

Functions

 adodb_date_test_date ($y1, $m, $d=13)
 
 adodb_date_test_strftime ($fmt)
 
 adodb_date_test ()
 
 adodb_time ()
 
 adodb_dow ($year, $month, $day)
 
 _adodb_is_leap_year ($year)
 
 adodb_is_leap_year ($year)
 
 adodb_year_digit_check ($y)
 
 adodb_get_gmt_diff_ts ($ts)
 
 adodb_get_gmt_diff ($y, $m, $d)
 
 adodb_getdate ($d=false, $fast=false)
 
 adodb_validdate ($y, $m, $d)
 
 _adodb_getdate ($origd=false, $fast=false, $is_gmt=false)
 
 adodb_tz_offset ($gmt, $isphp5)
 
 adodb_gmdate ($fmt, $d=false)
 
 adodb_date2 ($fmt, $d=false, $is_gmt=false)
 
 adodb_date ($fmt, $d=false, $is_gmt=false)
 
 adodb_gmmktime ($hr, $min, $sec, $mon=false, $day=false, $year=false, $is_dst=false)
 
 adodb_mktime ($hr, $min, $sec, $mon=false, $day=false, $year=false, $is_dst=false, $is_gmt=false)
 
 adodb_gmstrftime ($fmt, $ts=false)
 
 adodb_strftime ($fmt, $ts=false, $is_gmt=false)
 

Variables

const ADODB_DATE_VERSION 0.35
 
 $ADODB_DATETIME_CLASS = (PHP_VERSION >= 5.2)
 
 if (!defined( 'ADODB_ALLOW_NEGATIVE_TS')) define( 'ADODB_NO_NEGATIVE_TS'
 
 $_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31)
 
 $_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31)
 

Function Documentation

◆ _adodb_getdate()

_adodb_getdate (   $origd = false,
  $fast = false,
  $is_gmt = false 
)

Low-level function that returns the getdate() array. We have a special $fast flag, which if set to true, will return fewer array values, and is much faster as it does not calculate dow, etc.

Definition at line 829 of file adodb-time.inc.php.

References $_month_table_leaf, $_month_table_normal, $a, _adodb_is_leap_year(), adodb_dow(), and adodb_get_gmt_diff_ts().

Referenced by adodb_date(), and adodb_getdate().

◆ _adodb_is_leap_year()

_adodb_is_leap_year (   $year)

Checks for leap year, returns true if it is. No 2-digit year check. Also handles julian calendar correctly.

Definition at line 667 of file adodb-time.inc.php.

Referenced by _adodb_getdate(), adodb_is_leap_year(), adodb_mktime(), and adodb_validdate().

◆ adodb_date()

◆ adodb_date2()

adodb_date2 (   $fmt,
  $d = false,
  $is_gmt = false 
)

Definition at line 1047 of file adodb-time.inc.php.

References adodb_date(), and adodb_mktime().

◆ adodb_date_test()

◆ adodb_date_test_date()

adodb_date_test_date (   $y1,
  $m,
  $d = 13 
)

Definition at line 423 of file adodb-time.inc.php.

References adodb_date(), and adodb_mktime().

Referenced by adodb_date_test().

◆ adodb_date_test_strftime()

adodb_date_test_strftime (   $fmt)

Definition at line 437 of file adodb-time.inc.php.

References adodb_strftime().

Referenced by adodb_date_test().

◆ adodb_dow()

adodb_dow (   $year,
  $month,
  $day 
)

Returns day of week, 0 = Sunday,... 6=Saturday. Algorithm from PEAR::Date_Calc

Definition at line 629 of file adodb-time.inc.php.

Referenced by _adodb_getdate(), and adodb_date().

◆ adodb_get_gmt_diff()

adodb_get_gmt_diff (   $y,
  $m,
  $d 
)

get local time zone offset from GMT. Does not handle historical timezones before 1970.

Definition at line 734 of file adodb-time.inc.php.

References $ADODB_DATETIME_CLASS.

Referenced by adodb_date(), adodb_get_gmt_diff_ts(), and adodb_mktime().

◆ adodb_get_gmt_diff_ts()

adodb_get_gmt_diff_ts (   $ts)

Definition at line 717 of file adodb-time.inc.php.

References adodb_get_gmt_diff().

Referenced by _adodb_getdate().

◆ adodb_getdate()

adodb_getdate (   $d = false,
  $fast = false 
)

Returns an array with date info.

Definition at line 770 of file adodb-time.inc.php.

References _adodb_getdate().

Referenced by adodb_date_test().

◆ adodb_gmdate()

adodb_gmdate (   $fmt,
  $d = false 
)

Definition at line 1041 of file adodb-time.inc.php.

References adodb_date().

◆ adodb_gmmktime()

adodb_gmmktime (   $hr,
  $min,
  $sec,
  $mon = false,
  $day = false,
  $year = false,
  $is_dst = false 
)

Returns a timestamp given a GMT/UTC time. Note that $is_dst is not implemented and is ignored.

Definition at line 1235 of file adodb-time.inc.php.

References adodb_mktime().

◆ adodb_gmstrftime()

adodb_gmstrftime (   $fmt,
  $ts = false 
)

Definition at line 1354 of file adodb-time.inc.php.

References adodb_strftime().

◆ adodb_is_leap_year()

adodb_is_leap_year (   $year)

checks for leap year, returns true if it is. Has 2-digit year check

Definition at line 685 of file adodb-time.inc.php.

References _adodb_is_leap_year(), and adodb_year_digit_check().

◆ adodb_mktime()

adodb_mktime (   $hr,
  $min,
  $sec,
  $mon = false,
  $day = false,
  $year = false,
  $is_dst = false,
  $is_gmt = false 
)

Return a timestamp given a local time. Originally by jackbbs. Note that $is_dst is not implemented and is ignored.

Not a very fast algorithm - O(n) operation. Could be optimized to O(1).

Definition at line 1246 of file adodb-time.inc.php.

References $_month_table_leaf, $_month_table_normal, $a, _adodb_is_leap_year(), adodb_get_gmt_diff(), and adodb_year_digit_check().

Referenced by adodb_date2(), adodb_date_test(), adodb_date_test_date(), adodb_gmmktime(), ADORecordSet_array_sybase\UnixDate(), ADORecordSet_array_mssqlnative\UnixDate(), ADORecordSet_array_sybase\UnixTimeStamp(), and ADORecordSet_array_mssqlnative\UnixTimeStamp().

◆ adodb_strftime()

adodb_strftime (   $fmt,
  $ts = false,
  $is_gmt = false 
)

Definition at line 1360 of file adodb-time.inc.php.

References $sep, and adodb_date().

Referenced by adodb_date_test_strftime(), and adodb_gmstrftime().

◆ adodb_time()

adodb_time ( )

Definition at line 619 of file adodb-time.inc.php.

◆ adodb_tz_offset()

adodb_tz_offset (   $gmt,
  $isphp5 
)

Definition at line 1030 of file adodb-time.inc.php.

Referenced by adodb_date().

◆ adodb_validdate()

adodb_validdate (   $y,
  $m,
  $d 
)

◆ adodb_year_digit_check()

adodb_year_digit_check (   $y)

Fix 2-digit years. Works for any century. Assumes that if 2-digit is more than 30 years in future, then previous century.

Definition at line 694 of file adodb-time.inc.php.

Referenced by adodb_date_test(), adodb_is_leap_year(), and adodb_mktime().

Variable Documentation

◆ $_month_table_leaf

$_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31)

Definition at line 804 of file adodb-time.inc.php.

Referenced by _adodb_getdate(), adodb_mktime(), and adodb_validdate().

◆ $_month_table_normal

$_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31)

Definition at line 803 of file adodb-time.inc.php.

Referenced by _adodb_getdate(), adodb_mktime(), and adodb_validdate().

◆ $ADODB_DATETIME_CLASS

$ADODB_DATETIME_CLASS = (PHP_VERSION >= 5.2)

Definition at line 406 of file adodb-time.inc.php.

Referenced by adodb_date(), and adodb_get_gmt_diff().

◆ ADODB_DATE_VERSION

const ADODB_DATE_VERSION 0.35

Definition at line 404 of file adodb-time.inc.php.

◆ if

if(!defined('ADODB_ALLOW_NEGATIVE_TS')) define('ADODB_NO_NEGATIVE_TS'

Definition at line 421 of file adodb-time.inc.php.

Referenced by adodb_date().