* @param String $strfDateTime
* @return DateAndTime
*/
- function DateAndTime($format="",$strfDateTime="") {
+ function __construct($format="",$strfDateTime="") {
$this->mLocalFormat = ($format ? $format : $this->mIntrFormat);
$d = ($strfDateTime ? $strfDateTime : $this->do_strftime($this->mLocalFormat));
$this->parseVal($d);
}
function isError() {
- if ($this->mParseResult!=0) return true;
+ if ($this->mParseResult != 0) return true;
return false;
}
- function getClone() {
- if (version_compare(phpversion(), '5.0') < 0) {
- $d = new DateAndTime($this->getFormat());
- $d->setTimestamp($this->getTimestamp());
- return $d;
- } else {
- return clone($this);
- }
- }
-
function before(/*DateAndTime*/ $obj) {
- if ($this->getTimestamp()<$obj->getTimestamp()) return true;
+ if ($this->getTimestamp() < $obj->getTimestamp()) return true;
return false;
}
function after(/*DateAndTime*/ $obj) {
- if ($this->getTimestamp()>$obj->getTimestamp()) return true;
+ if ($this->getTimestamp() > $obj->getTimestamp()) return true;
return false;
}
return false;
}
- function nextDate() {
- $d = $this->getClone();
- $d->incDay();
- return $d;
- }
-
function decDay(/*int*/$days=1) {
$this->setTimestamp(@mktime($this->mHour, $this->mMinute, $this->mSecond, $this->mMonth, $this->mDate - $days, $this->mYear));
}