phpCoreLib2
[ class tree: phpCoreLib2 ] [ index: phpCoreLib2 ] [ all elements ]

Class: DDate

Source Location: /DateTime/DDate.php

Class Overview

DObject
   |
   --DDate

Date utility class


Implements interfaces:

Variables

Constants

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: DObject

DObject::__construct()
Constructor
DObject::debug()
Debig
DObject::getClassMembers()
Gets member variables of the instance
DObject::getClassMemberType()
Gets class member type
DObject::getClassMethods()
Gets classes of the class
DObject::getClassName()
Gets class name
DObject::PHPSerialize()
Gets serialized string of the class
DObject::trace()
Trace
DObject::__destruct()
Descructor
DObject::__toString()
Returns String equivalent of the object.

Class Details

[line 17]
Date utility class



[ Top ]


Class Variables

$day =

[line 49]

Dat



Tags:

access:  public

Type:   int


[ Top ]

$hours =

[line 56]

Hours



Tags:

access:  public

Type:   int


[ Top ]

$minutes =

[line 63]

Minutes



Tags:

access:  public

Type:   int


[ Top ]

$month =

[line 42]

Month



Tags:

access:  public

Type:   int


[ Top ]

$monthStringToDigit = array(
        "Jan" => 1,
        "Feb" => 2,
        "Mar" => 3,
        "Apr" => 4,
        "May" => 5,
        "Jun" => 6,
        "Jul" => 7,
        "Aug" => 8,
        "Sep" => 9,
        "Oct" => 10,
        "Nov" => 11,
        "Dec" => 12
    )

[line 78]

Months to digits



Tags:

access:  public

Type:   array


[ Top ]

$seconds =

[line 70]

Seconds



Tags:

access:  public

Type:   int


[ Top ]

$startWeek =  1

[line 28]

Start week



Tags:

access:  public

Type:   int


[ Top ]

$year =

[line 35]

Year



Tags:

access:  public

Type:   int


[ Top ]



Class Methods


static method toCustomStatic [line 317]

static string toCustomStatic( string $customFormat)

To custom format



Tags:

access:  public


Parameters:

string   $customFormat  

[ Top ]

constructor __construct [line 101]

DDate __construct( [int $year = null], [int $month = null], [int $day = null], [ $hours = null], [ $minutes = null], [ $seconds = null])

Constructor



Tags:

access:  public


Overrides DObject::__construct() (Constructor)

Parameters:

int   $year  
int   $month  
int   $day  
   $hours  
   $minutes  
   $seconds  

[ Top ]

method changeDate [line 460]

void changeDate( [string $item = DDateDimensions::DAY], [int $offset = 1])

Changes date



Tags:

access:  public


Parameters:

string   $item  
int   $offset  

[ Top ]

method clear [line 118]

void clear( )

Resets data



Tags:

access:  public


[ Top ]

method compare [line 473]

boolean compare( DDate $DDateObject)

Comapres 2 DDate objects for day & month & year



Tags:

access:  public


Parameters:

DDate   $DDateObject  

[ Top ]

method compareTimestamp [line 488]

int compareTimestamp( DDate $DDateObject)

Camares 2 DDate objects as timestamp



Tags:

access:  public


Parameters:

DDate   $DDateObject  

[ Top ]

method daysInMonth [line 448]

string daysInMonth( )

Gets days in month



Tags:

access:  public


[ Top ]

method firstDay [line 379]

int firstDay( )

Gets first day



Tags:

access:  public


[ Top ]

method firstDayOfWeek [line 424]

int firstDayOfWeek( )

Gets first day of the week



Tags:

access:  public


[ Top ]

method firstDayOfYear [line 413]

int firstDayOfYear( )

Gets first da of the year



Tags:

access:  public


[ Top ]

method firstMDay [line 390]

int firstMDay( )

Gets first day of the month



Tags:

access:  public


[ Top ]

method firstWeek [line 437]

int firstWeek( )

Gets first week



Tags:

access:  public


[ Top ]

method fromDDMMYYYY [line 201]

void fromDDMMYYYY( string $DDateObject)

Sets the object fields day, month and year from String format "dd-mm-yyyy"



Tags:

access:  public


Parameters:

string   $DDateObject  

[ Top ]

method fromMMDDYYYY [line 218]

void fromMMDDYYYY( string $DDateObject)

Sets the object fields month, day and year from String format "mm-dd-yyyy"



Tags:

access:  public


Parameters:

string   $DDateObject  

[ Top ]

method fromMySQLDate [line 134]

void fromMySQLDate( string $DDateObject)

Populate data from MySQL date format



Tags:

access:  public


Parameters:

string   $DDateObject  

[ Top ]

method fromMySQLDateTime [line 150]

void fromMySQLDateTime( string $DDateObject)

Populates data from MySQL datetime format



Tags:

access:  public


Parameters:

string   $DDateObject  

[ Top ]

method fromRFC822 [line 182]

void fromRFC822( string $DDateObject)

Populates data from RFC822 format



Tags:

access:  public


Parameters:

string   $DDateObject  

[ Top ]

method fromTimestamp [line 166]

void fromTimestamp( int $timeStamp)



Tags:

access:  public


Parameters:

int   $timeStamp  

[ Top ]

method getClone [line 612]

DDate getClone( )

Close object



Tags:

access:  public



Implementation of:
DClonable::getClone()
get clone method
[ Top ]

method getDaysDiffBetweenDates [line 508]

int getDaysDiffBetweenDates( DDate $DDateObject)

Gets difference in days between 2 DDate objects



Tags:

access:  public


Parameters:

DDate   $DDateObject  

[ Top ]

method isWeekend [line 348]

boolean isWeekend( )

Check if is weekend



Tags:

access:  public


[ Top ]

method lastMDay [line 401]

int lastMDay( )

Gets last day of the month



Tags:

access:  public


[ Top ]

method nextDay [line 518]

void nextDay( )

Moves to next day



Tags:

access:  public


[ Top ]

method nextMonth [line 558]

void nextMonth( )

Moves to next month



Tags:

access:  public


[ Top ]

method nextWeek [line 538]

void nextWeek( )

Moves to next week - adds 7 days to the current day



Tags:

access:  public


[ Top ]

method nextYear [line 578]

void nextYear( )

Moves to next year



Tags:

access:  public


[ Top ]

method prevDay [line 528]

void prevDay( )

Moves to prev day



Tags:

access:  public


[ Top ]

method prevMonth [line 568]

void prevMonth( )

Moves to prev month



Tags:

access:  public


[ Top ]

method prevWeek [line 548]

void prevWeek( )

Moves to prev week - removes 7 days from the current day



Tags:

access:  public


[ Top ]

method prevYear [line 588]

void prevYear( )

Moves to prev year



Tags:

access:  public


[ Top ]

method toCustom [line 304]

string toCustom( string $custom)

To custom format



Tags:

access:  public


Parameters:

string   $custom  

[ Top ]

method toMySQLDate [line 234]

string toMySQLDate( )

Returns MySQL date format



Tags:

access:  public


[ Top ]

method toMySQLDateTime [line 244]

string toMySQLDateTime( )

Returns MySQL datetime format



Tags:

access:  public


[ Top ]

method toMySQLDateTimeButSeconds [line 254]

string toMySQLDateTimeButSeconds( )

Returns MySQL datetime format, but with no seconds



Tags:

access:  public


[ Top ]

method toRFC822 [line 281]

string toRFC822( )

To RFC822 format



Tags:

access:  public


[ Top ]

method toSyslogStyleDate [line 293]

string toSyslogStyleDate( )

To syslog style date



Tags:

access:  public


[ Top ]

method toTimestamp [line 264]

int toTimestamp( )

To timestamp



Tags:

access:  public


[ Top ]

method weekday [line 329]

int weekday( )

Gets weekday



Tags:

access:  public


[ Top ]

method weeknumber [line 367]

string weeknumber( )

Gets week number



Tags:

access:  public


[ Top ]

method __toString [line 599]

string __toString( [string $separator = "."])

To string



Tags:

access:  public


Overrides DObject::__toString() (Returns String equivalent of the object.)

Parameters:

string   $separator  

[ Top ]


Class Constants

MYSQL_DATETIME_FORMAT =  "Y-m-d H:i:s"

[line 19]


[ Top ]

MYSQL_DATETIME_NO_SECONDS_FORMAT =  "Y-m-d H:i"

[line 20]


[ Top ]

MYSQL_DATE_FORMAT =  "Y-m-d"

[line 18]


[ Top ]



Documentation generated on Sat, 17 Apr 2010 22:04:16 +0300 by phpDocumentor 1.4.3