@@ -25,7 +25,21 @@ function date_parse_from_format(string $format, string $datetime): ?array
2525
2626
2727/**
28- *
28+ * date_parse parses the given
29+ * datetime string according to the same rules as
30+ * strtotime and
31+ * DateTimeImmutable::__construct. Instead of returning a
32+ * Unix timestamp (with strtotime) or a
33+ * DateTimeImmutable object (with
34+ * DateTimeImmutable::__construct, it returns an
35+ * associative array with the information that it could detect in the given
36+ * datetime string.
37+ *
38+ * If no information about a certain group of elements can be found, these
39+ * array elements will be set to FALSE or are missing. If needed for
40+ * constructing a timestamp or DateTimeImmutable object from
41+ * the same datetime string, more fields can be set to
42+ * a non-FALSE value. See the examples for cases where that happens.
2943 *
3044 * @param string $datetime Date/time in format accepted by
3145 * DateTimeImmutable::__construct.
@@ -359,10 +373,15 @@ function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, fl
359373
360374/**
361375 * Returns a string formatted according to the given format string using the
362- * given integer timestamp or the current time
363- * if no timestamp is given. In other words, timestamp
376+ * given integer timestamp (Unix timestamp) or the current time
377+ * if no timestamp is given. In other words, timestamp
364378 * is optional and defaults to the value of time.
365379 *
380+ * Unix timestamps do not handle timezones. Use the
381+ * DateTimeImmutable class, and its
382+ * DateTimeInterface::format formatting method to
383+ * format date/time information with a timezone attached.
384+ *
366385 * @param string $format Format accepted by DateTimeInterface::format.
367386 * @param int $timestamp The optional timestamp parameter is an
368387 * int Unix timestamp that defaults to the current
0 commit comments