DateTimeImmutable::__construct

(PHP 5 >= 5.5.0, PHP 7) Returns new DateTimeImmutable object DateTimeImmutable date_create_immutable ([ string $time = "now" [, DateTimeZone $timezone = NULL ]] ) Object oriented style public DateTimeImmutable::__construct ([ string $time = "now" [, DateTimeZone $timezone = NULL ]] ) Procedural style Like DateTime::__construct() but works with DateTimeImmutable.

DateTime::sub

(PHP 5 >= 5.3.0, PHP 7) Subtracts an amount of days, months, years, hours, minutes and seconds from a DateTime object public DateTime DateTime::sub ( DateInterval $interval ) Object oriented style Procedural style DateTime date_sub ( DateTime $object , DateInterval $interval ) Subtracts the specified DateInterval object from the specified DateTime object. Parameters: object

DateTime::setTime

(PHP 5 >= 5.2.0, PHP 7) Sets the time public DateTime DateTime::setTime ( int $hour, int $minute [, int $second = 0 ] ) Object oriented style Procedural style DateTime date_time_set ( DateTime $object , int $hour , int $minute [, int $second = 0 ] ) Resets the current time of the DateTime object to a different time. Parameters: object Procedural style only: A DateTime

DateTime::setTimestamp

(PHP 5 >= 5.3.0, PHP 7) Sets the date and time based on an Unix timestamp public DateTime DateTime::setTimestamp ( int $unixtimestamp ) Object oriented style Procedural style DateTime date_timestamp_set ( DateTime $object , int $unixtimestamp ) Sets the date and time based on an Unix timestamp. Parameters: object Procedural style only: A DateTime object returned by dat

DateTime::setTimezone

(PHP 5 >= 5.2.0, PHP 7) Sets the time zone for the DateTime object public DateTime DateTime::setTimezone ( DateTimeZone $timezone ) Object oriented style Procedural style DateTime date_timezone_set ( DateTime $object , DateTimeZone $timezone ) Sets a new timezone for a DateTime object. Parameters: object Procedural style only: A DateTime object returned by date_create(

DateTime::setISODate

(PHP 5 >= 5.2.0, PHP 7) Sets the ISO date public DateTime DateTime::setISODate ( int $year, int $week [, int $day = 1 ] ) Object oriented style Procedural style DateTime date_isodate_set ( DateTime $object , int $year , int $week [, int $day = 1 ] ) Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates. Parameters: object

DateTime::modify

(PHP 5 >= 5.2.0, PHP 7) Alters the timestamp public DateTime DateTime::modify ( string $modify ) Object oriented style Procedural style DateTime date_modify ( DateTime $object , string $modify ) Alter the timestamp of a DateTime object by incrementing or decrementing in a format accepted by strtotime(). Parameters: object Procedural style only: A DateTime object return

DateTime::setDate

(PHP 5 >= 5.2.0, PHP 7) Sets the date public DateTime DateTime::setDate ( int $year, int $month, int $day ) Object oriented style Procedural style DateTime date_date_set ( DateTime $object , int $year , int $month , int $day ) Resets the current date of the DateTime object to a different date. Parameters: object Procedural style only: A DateTime object returned by date

DateTime::__set_state

(PHP 5 >= 5.2.0, PHP 7) The __set_state handler public static DateTime DateTime::__set_state ( array $array ) The __set_state() handler. Parameters: array Initialization array. Returns: Returns a new instance of a DateTime object.

DateTime::getLastErrors

(PHP 5 >= 5.3.0, PHP 7) Returns the warnings and errors public static array DateTime::getLastErrors ( void ) Object oriented style Procedural style array date_get_last_errors ( void ) Returns an array of warnings and errors found while parsing a date/time string. Returns: Returns array containing info about warnings and errors. Examples: