PHP Class Prado\Util\TDateTimeStamp

TDateTimeStamp Class is a wrapper to DateTime: http://php.net/manual/book.datetime.php Prado implemented this class before php started shipping the DateTime extension. This class is deprecated and left here only for compatibility for legacy code. Please note that this class doesn't support automatic conversion from gregorian to julian dates anymore.
Deprecation: since 3.2.1
Since: 3.0.4
Author: Fabio Bas ctrlaltca[AT]gmail[DOT]com
Mostrar archivo Open project: pradosoft/prado Class Usage Examples

Protected Properties

Property Type Description
$_month_leaf
$_month_normal

Public Methods

Method Description
formatDate ( $fmt, $ts = false, $is_gmt = false ) : string
get4DigitYear ( $y )
getDate ( $d = false, $fast = false ) : array
getDayofWeek ( $year, $month, $day ) Returns the day of the week (0=Sunday, 1=Monday, .
getGMTDiff ( $ts = false ) : integer
getTimeStamp ( $hr, $min, $sec, $mon = false, $day = false, $year = false, $is_gmt = false ) : integer | float
isLeapYear ( $year ) : boolean Checks for leap year, returns true if it is. No 2-digit year check. Also handles julian calendar correctly.
isValidDate ( $y, $m, $d ) : boolean
parseDate ( $txt = false ) : array

Protected Methods

Method Description
digitCheck ( $y ) : integer Fix 2-digit years. Works for any century.

Method Details

digitCheck() protected method

Assumes that if 2-digit is more than 30 years in future, then previous century.
protected digitCheck ( $y ) : integer
return integer change two digit year into multiple digits

formatDate() public method

public formatDate ( $fmt, $ts = false, $is_gmt = false ) : string
return string formatted date based on timestamp $d

get4DigitYear() public method

public get4DigitYear ( $y )

getDate() public method

public getDate ( $d = false, $fast = false ) : array
return array an array with date info.

getDayofWeek() public method

. 6=Saturday)
public getDayofWeek ( $year, $month, $day )

getGMTDiff() public method

public getGMTDiff ( $ts = false ) : integer
return integer get local time zone offset from GMT

getTimeStamp() public method

public getTimeStamp ( $hr, $min, $sec, $mon = false, $day = false, $year = false, $is_gmt = false ) : integer | float
return integer | float a timestamp given a local time

isLeapYear() public method

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

isValidDate() public method

public isValidDate ( $y, $m, $d ) : boolean
return boolean true if valid date, semantic check only.

parseDate() public method

public parseDate ( $txt = false ) : array
return array an array with date info.

Property Details

$_month_leaf protected_oe static_oe property

protected static $_month_leaf

$_month_normal protected_oe static_oe property

protected static $_month_normal