[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/Util/ -> TDateTimeStamp.php (sommaire)

TDateTimeStamp class file. COPYRIGHT (c) 2003-2005 John Lim and released under BSD-style license except for code by jackbbs, which includes getTimeStamp, getGMTDiff, isLeapYear and originally found at http://www.php.net/manual/en/function.mktime.php

Author: Wei Zhuo
Copyright: Copyright © 2006 PradoSoft
License: http://www.pradosoft.com/license/
Version: $Revision: 30/08/2006 $
Poids: 703 lignes (18 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

TDateTimeStamp:: (10 méthodes):
  getDayofWeek()
  isLeapYear()
  digitCheck()
  get4DigitYear()
  getGMTDiff()
  getDate()
  _getDateInternal()
  isValidDate()
  formatDate()
  getTimeStamp()


Classe: TDateTimeStamp  - X-Ref

TDateTimeStamp Class

TDateTimeStamp Class is adpated from the ADOdb Date Library,
part of the ADOdb abstraction library
Download: http://phplens.com/phpeverywhere/

http://phplens.com/phpeverywhere/adodb_date_library

PHP native date functions use integer timestamps for computations.
Because of this, dates are restricted to the years 1901-2038 on Unix
and 1970-2038 on Windows due to integer overflow for dates beyond
those years. This library overcomes these limitations by replacing the
native function's signed integers (normally 32-bits) with PHP floating
point numbers (normally 64-bits).

Dates from 100 A.D. to 3000 A.D. and later have been tested. The minimum
is 100 A.D. as <100 will invoke the 2 => 4 digit year conversion.
The maximum is billions of years in the future, but this is a theoretical
limit as the computation of that year would take too long with the
current implementation of {@link getTimeStamp}.

PERFORMANCE
For high speed, this library uses the native date functions where
possible, and only switches to PHP code when the dates fall outside
the 32-bit signed integer range.

getDayofWeek($year, $month, $day)   X-Ref
Gets day of week, 0 = Sunday,... 6=Saturday.
Algorithm from PEAR::Date_Calc


isLeapYear($year)   X-Ref
Checks for leap year, returns true if it is. No 2-digit year check. Also
handles julian calendar correctly.

param: float year to check
return: boolean true if is leap year

digitCheck($y)   X-Ref
Fix 2-digit years. Works for any century.
Assumes that if 2-digit is more than 30 years in future, then previous century.

return: integer change two digit year into multiple digits

get4DigitYear($y)   X-Ref
Pas de description

getGMTDiff()   X-Ref

return: integer get local time zone offset from GMT

getDate($d=false,$fast=false)   X-Ref

return: array an array with date info.

_getDateInternal($origd=false,$fast=true,$is_gmt=false)   X-Ref
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.

param: float orginal date
param: boolean false to compute the day of the week, default is true
param: boolean true to calculate the GMT dates
return: array an array with date info.

isValidDate($y,$m,$d)   X-Ref

return: boolean true if valid date, semantic check only.

formatDate($fmt,$d=false,$is_gmt=false)   X-Ref

return: string formatted date based on timestamp $d

getTimeStamp($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_gmt=false)   X-Ref
Not a very fast algorithm - O(n) operation. Could be optimized to O(1).

return: integer|float a timestamp given a local time. Originally by jackbbs.



Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7