コード例 #1
0
 /**
  * Test the DateAndTime representing the Squeak epoch: 1 January 1901.
  */
 function test_epoch()
 {
     $dateAndTime = DateAndTime::epoch();
     $this->assertEqual($dateAndTime->year(), 1901);
     $this->assertEqual($dateAndTime->month(), 1);
     $this->assertEqual($dateAndTime->day(), 1);
     $dateAndTime = DateAndTime::withYearMonthDayHourMinuteSecondOffset(1901, 1, 1, 0, 0, 0, $null = NULL);
     $this->assertEqual($dateAndTime->year(), 1901);
     $this->assertEqual($dateAndTime->month(), 1);
     $this->assertEqual($dateAndTime->day(), 1);
     $dateAndTime = DateAndTime::withYearMonthDayHourMinuteSecondOffset(1901, 'jan', 1, 0, 0, 0, $null = NULL);
     $this->assertEqual($dateAndTime->year(), 1901);
     $this->assertEqual($dateAndTime->month(), 1);
     $this->assertEqual($dateAndTime->day(), 1);
     $dateAndTime = DateAndTime::withYearMonthDayHourMinuteSecondOffset(1901, 'January', 1, 0, 0, 0, $null = NULL);
     $this->assertEqual($dateAndTime->year(), 1901);
     $this->assertEqual($dateAndTime->month(), 1);
     $this->assertEqual($dateAndTime->day(), 1);
 }
コード例 #2
0
 /**
  * Get the date at which this Asset was created.
  *  
  * WARNING: NOT IN OSID
  *
  * @return object DateAndTime
  * 
  * @throws object RepositoryException An exception with one of
  *         the following messages defined in
  *         org.osid.repository.RepositoryException may be thrown: {@link
  *         org.osid.repository.RepositoryException#OPERATION_FAILED
  *         OPERATION_FAILED}, {@link
  *         org.osid.repository.RepositoryException#PERMISSION_DENIED
  *         PERMISSION_DENIED}, {@link
  *         org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  *         CONFIGURATION_ERROR}, {@link
  *         org.osid.repository.RepositoryException#UNIMPLEMENTED
  *         UNIMPLEMENTED}
  * 
  * @access public
  */
 function getModificationDate()
 {
     if (!isset($this->_modifyDate) || $this->_modifyDate->isEqualTo(DateAndTime::epoch())) {
         $this->_loadDates();
     }
     return $this->_modifyDate;
 }
コード例 #3
0
 /**
  * Answer a TimeStamp representing the Squeak epoch: 1 January 1901
  * 
  * @param optional string $class DO NOT USE OUTSIDE OF PACKAGE.
  *		This parameter is used to get around the limitations of not being
  *		able to find the class of the object that recieved the initial 
  *		method call.
  * @return object TimeStamp
  * @access public
  * @since 5/2/05
  * @static
  */
 static function epoch($class = 'TimeStamp')
 {
     $obj = parent::epoch($class);
     return $obj;
 }
コード例 #4
0
 /**
  * Answer a StorableTime representing the Squeak epoch: 1 January 1901
  * 
  * @param optional string $class DO NOT USE OUTSIDE OF PACKAGE.
  *		This parameter is used to get around the limitations of not being
  *		able to find the class of the object that recieved the initial 
  *		method call.
  * @return object StorableTime
  * @access public
  * @since 5/2/05
  * @static
  */
 static function epoch($class = 'StorableTime')
 {
     return parent::epoch($class);
 }