ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
MDB2_Date Class Reference
+ Collaboration diagram for MDB2_Date:

Public Member Functions

 mdbNow ()
 return the current datetime
 mdbToday ()
 return the current date
 mdbTime ()
 return the current time
 date2Mdbstamp ($hour=null, $minute=null, $second=null, $month=null, $day=null, $year=null)
 convert a date into a MDB2 timestamp
 unix2Mdbstamp ($unix_timestamp)
 convert a unix timestamp into a MDB2 timestamp
 mdbstamp2Unix ($mdb_timestamp)
 convert a MDB2 timestamp into a unix timestamp
 mdbstamp2Date ($mdb_timestamp)
 convert a MDB2 timestamp into an array containing all values necessary to pass to php's date() function

Detailed Description

Definition at line 63 of file Date.php.

Member Function Documentation

MDB2_Date::date2Mdbstamp (   $hour = null,
  $minute = null,
  $second = null,
  $month = null,
  $day = null,
  $year = null 
)

convert a date into a MDB2 timestamp

Parameters
inthour of the date
intminute of the date
intsecond of the date
intmonth of the date
intday of the date
intyear of the date
Returns
string a valid MDB2 timestamp public

Definition at line 122 of file Date.php.

References unix2Mdbstamp().

{
return MDB2_Date::unix2Mdbstamp(mktime($hour, $minute, $second, $month, $day, $year, -1));
}

+ Here is the call graph for this function:

MDB2_Date::mdbNow ( )

return the current datetime

Returns
string current datetime in the MDB2 format public

Definition at line 73 of file Date.php.

Referenced by Log_mdb2\log().

{
return date('Y-m-d H:i:s');
}

+ Here is the caller graph for this function:

MDB2_Date::mdbstamp2Date (   $mdb_timestamp)

convert a MDB2 timestamp into an array containing all values necessary to pass to php's date() function

Parameters
inta valid MDB2 timestamp
Returns
array with the time split public

Definition at line 174 of file Date.php.

Referenced by mdbstamp2Unix().

{
list($arr['year'], $arr['month'], $arr['day'], $arr['hour'], $arr['minute'], $arr['second']) =
sscanf($mdb_timestamp, "%04u-%02u-%02u %02u:%02u:%02u");
return $arr;
}

+ Here is the caller graph for this function:

MDB2_Date::mdbstamp2Unix (   $mdb_timestamp)

convert a MDB2 timestamp into a unix timestamp

Parameters
inta valid MDB2 timestamp
Returns
string unix timestamp with the time stored in the MDB2 format

public

Definition at line 155 of file Date.php.

References mdbstamp2Date().

{
$arr = MDB2_Date::mdbstamp2Date($mdb_timestamp);
return mktime($arr['hour'], $arr['minute'], $arr['second'], $arr['month'], $arr['day'], $arr['year'], -1);
}

+ Here is the call graph for this function:

MDB2_Date::mdbTime ( )

return the current time

Returns
string current time in the MDB2 format public

Definition at line 101 of file Date.php.

{
return date('H:i:s');
}
MDB2_Date::mdbToday ( )

return the current date

Returns
string current date in the MDB2 format public

Definition at line 87 of file Date.php.

{
return date('Y-m-d');
}
MDB2_Date::unix2Mdbstamp (   $unix_timestamp)

convert a unix timestamp into a MDB2 timestamp

Parameters
inta valid unix timestamp
Returns
string a valid MDB2 timestamp public

Definition at line 139 of file Date.php.

Referenced by date2Mdbstamp().

{
return date('Y-m-d H:i:s', $unix_timestamp);
}

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: