Class class_date

Description

The date class is used to handle all kind of date and time related operations.

As soon as the most installations will run on PHP >= 5.3.0, this class will be wrapper to phps' DateTime class. Up till then, the class provides a few ways to handle date and convert them to a long value not being limited by the 32 bit time() boundaries (> 1970 && < 2038). Use this class only in cases the other way won't work, so e.g. for birthdays.

Located in /system/class_date.php (line 20)


	
			
Method Summary
static long getCurrentTimestamp ()
class_date __construct ([ $longInitValue = ""])
void generateDateFromParams (string $strFieldname, array $arrParams)
int getIntDay ()
int getIntHour ()
int getIntMin ()
int getIntMonth ()
int getIntSec ()
int getIntYear ()
void setIntDay ( $intDay, int $intYear)
void setIntHour ( $intHour, [ $bitForce = false], int $intYear)
void setIntMin ( $intMin, [ $bitForce = false], int $intYear)
void setIntMonth ( $intMonth, int $intYear)
void setIntSec ( $intSec, [ $bitForce = false], int $intYear)
void setIntYear (int $intYear)
void setLongTimestamp (long $longTimestamp)
void setTimeInOldStyle (int $intTimestamp)
string __toString ()
Methods
static getCurrentTimestamp (line 67)

Generates a long-timestamp of the current time

  • access: public
static long getCurrentTimestamp ()
Constructor __construct (line 34)

Creates an instance of the class_date an initialises it with the current date.

  • access: public
class_date __construct ([ $longInitValue = ""])
  • $longInitValue
generateDateFromParams (line 83)

Sets the current time based on the array of params passed.

The fieldname is the prefix of the form-elements. The timestamp is generated out of the following form-elements, so element of the params-array: fieldname_year, fieldname_month, fieldname_day, fieldname_hour, fieldname_minute, fieldname_second If a single field is not found, 00 is inserted instead.

  • access: public
void generateDateFromParams (string $strFieldname, array $arrParams)
  • string $strFieldname
  • array $arrParams
getIntDay (line 232)

Get the day part

  • access: public
int getIntDay ()
getIntHour (line 241)

Get the hour part

  • access: public
int getIntHour ()
getIntMin (line 250)

Get the min part

  • access: public
int getIntMin ()
getIntMonth (line 223)

Get the month part

  • access: public
int getIntMonth ()
getIntSec (line 259)

Get the sec part

  • access: public
int getIntSec ()
getIntYear (line 214)

Get the year part

  • access: public
int getIntYear ()
getLongTimestamp (line 268)

Get the timstamp as a long value

  • access: public
long getLongTimestamp ()
setIntDay (line 162)

Swap the day part

  • access: public
void setIntDay ( $intDay, int $intYear)
  • int $intYear
  • $intDay
setIntHour (line 175)

Swap the hour part

  • access: public
void setIntHour ( $intHour, [ $bitForce = false], int $intYear)
  • int $intYear
  • $intHour
  • $bitForce
setIntMin (line 188)

Swap the minutes part

  • access: public
void setIntMin ( $intMin, [ $bitForce = false], int $intYear)
  • int $intYear
  • $intMin
  • $bitForce
setIntMonth (line 149)

Swap the month part

  • access: public
void setIntMonth ( $intMonth, int $intYear)
  • int $intYear
  • $intMonth
setIntSec (line 201)

Swap the seconds part

  • access: public
void setIntSec ( $intSec, [ $bitForce = false], int $intYear)
  • int $intYear
  • $intSec
  • $bitForce
setIntYear (line 134)

Swap the year part

  • access: public
void setIntYear (int $intYear)
  • int $intYear
setLongTimestamp (line 277)

Set the current timestamp

  • access: public
void setLongTimestamp (long $longTimestamp)
  • long $longTimestamp
setTimeInOldStyle (line 124)

Allows to init the current class with an 32Bit int value representing the seconds since 1970.

PHPs' time() returns 32Bit ints, too.

  • access: public
void setTimeInOldStyle (int $intTimestamp)
  • int $intTimestamp
__toString (line 59)

Returns the string-based version of the long-value currently maintained.

  • access: public
string __toString ()

Documentation generated on Mon, 12 Apr 2010 21:20:00 +0200 by phpDocumentor 1.4.3