ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
MDB2_Date Class Reference
+ Collaboration diagram for MDB2_Date:

Public Member Functions

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

Detailed Description

Definition at line 63 of file Date.php.

Member Function Documentation

◆ date2Mdbstamp()

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 @access public

Definition at line 122 of file Date.php.

124 {
125 return MDB2_Date::unix2Mdbstamp(mktime($hour, $minute, $second, $month, $day, $year, -1));
126 }
unix2Mdbstamp($unix_timestamp)
convert a unix timestamp into a MDB2 timestamp
Definition: Date.php:139

References unix2Mdbstamp().

+ Here is the call graph for this function:

◆ mdbNow()

MDB2_Date::mdbNow ( )

return the current datetime

Returns
string current datetime in the MDB2 format @access public

Definition at line 73 of file Date.php.

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

Referenced by Log_mdb2\log().

+ Here is the caller graph for this function:

◆ mdbstamp2Date()

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 @access public

Definition at line 174 of file Date.php.

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

Referenced by mdbstamp2Unix().

+ Here is the caller graph for this function:

◆ mdbstamp2Unix()

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

@access public

Definition at line 155 of file Date.php.

156 {
157 $arr = MDB2_Date::mdbstamp2Date($mdb_timestamp);
158
159 return mktime($arr['hour'], $arr['minute'], $arr['second'], $arr['month'], $arr['day'], $arr['year'], -1);
160 }
mdbstamp2Date($mdb_timestamp)
convert a MDB2 timestamp into an array containing all values necessary to pass to php's date() functi...
Definition: Date.php:174

References mdbstamp2Date().

+ Here is the call graph for this function:

◆ mdbTime()

MDB2_Date::mdbTime ( )

return the current time

Returns
string current time in the MDB2 format @access public

Definition at line 101 of file Date.php.

102 {
103 return date('H:i:s');
104 }

◆ mdbToday()

MDB2_Date::mdbToday ( )

return the current date

Returns
string current date in the MDB2 format @access public

Definition at line 87 of file Date.php.

88 {
89 return date('Y-m-d');
90 }

◆ unix2Mdbstamp()

MDB2_Date::unix2Mdbstamp (   $unix_timestamp)

convert a unix timestamp into a MDB2 timestamp

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

Definition at line 139 of file Date.php.

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

Referenced by date2Mdbstamp().

+ Here is the caller graph for this function:

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