Menu Samaritan's Purse

DATE_CREATE_IMMUTABLE

Returns new DateTimeImmutable object

SYNTAX

date_create_immutable ([ string $datetime = "now" [, DateTimeZone $timezone = NULL ]] ) : DateTimeImmutable

PARAMETERS

datetime

String representing the time.

timezone

A DateTimeZone object representing the desired time zone. If timezone is omitted and time contains no timezone, the current timezone will be used. Note: The timezone parameter and the current timezone are ignored when the time parameter either contains a UNIX timestamp (e.g. 946684800) or specifies a timezone (e.g. 2010-01-28T15:00:00+02:00).

RETURN

Returns a new DateTimeImmutable instance or FALSE on failure.

EXAMPLES

VOID

2020-10-28 08:51:48

DATETIME

2001-01-01 12:00:00

TIMEZONE

2020-10-28 01:51:48

PHP