/** * Outputs this date-time as a {@code String}, such as {@code 2007-12-03T10:15:30}. * <p> * The output will be one of the following ISO-8601 formats: * <ul> * <li>{@code uuuu-MM-dd'T'HH:mm}</li> * <li>{@code uuuu-MM-dd'T'HH:mm:ss}</li> * <li>{@code uuuu-MM-dd'T'HH:mm:ss.SSS}</li> * <li>{@code uuuu-MM-dd'T'HH:mm:ss.SSSSSS}</li> * <li>{@code uuuu-MM-dd'T'HH:mm:ss.SSSSSSSSS}</li> * </ul> * The format used will be the shortest that outputs the full value of * the time where the omitted parts are implied to be zero. * * @return string a string representation of this date-time, not null */ public function __toString() { return $this->date->__toString() . 'T' . $this->time->__toString(); }
/** * Outputs this time as a {@code String}, such as {@code 10:15:30+01:00}. * <p> * The output will be one of the following ISO-8601 formats: * <ul> * <li>{@code HH:mmXXXXX}</li> * <li>{@code HH:mm:ssXXXXX}</li> * <li>{@code HH:mm:ss.SSSXXXXX}</li> * <li>{@code HH:mm:ss.SSSSSSXXXXX}</li> * <li>{@code HH:mm:ss.SSSSSSSSSXXXXX}</li> * </ul> * The format used will be the shortest that outputs the full value of * the time where the omitted parts are implied to be zero. * * @return string a string representation of this time, not null */ public function __toString() { return $this->time->__toString() . $this->offset->__toString(); }