diff --git a/reference/datetime/datetimeinterface/diff.xml b/reference/datetime/datetimeinterface/diff.xml index 9c8c871aa..8dc94b00f 100644 --- a/reference/datetime/datetimeinterface/diff.xml +++ b/reference/datetime/datetimeinterface/diff.xml @@ -1,6 +1,6 @@ - + @@ -121,8 +121,8 @@ echo $interval->format('%R%a days'); diff($targedTime); +$targetTime = new DateTimeImmutable("2021-10-31 08:30:00 Europe/London"); +$interval = $originalTime->diff($targetTime); echo $interval->format("%H:%I:%S (Full days: %a)"), "\n"; ?> ]]> @@ -146,8 +146,8 @@ echo $interval->format("%H:%I:%S (Full days: %a)"), "\n"; diff($targedTime); +$targetTime = new DateTimeImmutable("2023-12-31 UTC"); +$interval = $originalTime->diff($targetTime); echo "Full days: ", $interval->format("%a"), "\n"; ?> ]]> diff --git a/reference/datetime/functions/date.xml b/reference/datetime/functions/date.xml index 503c453b3..62b4be1c0 100755 --- a/reference/datetime/functions/date.xml +++ b/reference/datetime/functions/date.xml @@ -1,7 +1,7 @@ - - + + date @@ -39,7 +39,8 @@ date 将始终生成 000000 作为微秒,因为它采用 int - 参数,而如果 DateTime 是用微秒创建的,则 DateTime::format 支持微秒。 + 参数,而如果 DateTimeInterface 类型的对象是用微秒创建的, + 则 DateTimeInterface::format 支持微秒。 diff --git a/reference/datetime/functions/mktime.xml b/reference/datetime/functions/mktime.xml index 73f4b50cd..51d154a29 100755 --- a/reference/datetime/functions/mktime.xml +++ b/reference/datetime/functions/mktime.xml @@ -1,6 +1,6 @@ - + @@ -195,10 +195,13 @@ echo date("M-d-Y", mktime(0, 0, 0, 1, 1, 98)); ]]> diff --git a/reference/datetime/functions/strftime.xml b/reference/datetime/functions/strftime.xml index df3910880..2da9b4883 100755 --- a/reference/datetime/functions/strftime.xml +++ b/reference/datetime/functions/strftime.xml @@ -1,7 +1,7 @@ - - + + strftime @@ -516,7 +516,8 @@ echo strftime($format); 'A full textual representation of the day', 'B' => 'Full month name, based on the locale', @@ -573,28 +574,29 @@ $strftimeFormats = array( '%' => 'A literal percentage character ("%")', ); -// Results. +// Results $strftimeValues = array(); -// Evaluate the formats whilst suppressing any errors. -foreach($strftimeFormats as $format => $description){ - if (False !== ($value = @strftime("%{$format}"))){ +// Evaluate the formats whilst suppressing any errors +foreach ($strftimeFormats as $format => $description) { + if (false !== ($value = @strftime("%{$format}"))) { $strftimeValues[$format] = $value; } } -// Find the longest value. +// Find the longest value $maxValueLength = 2 + max(array_map('strlen', $strftimeValues)); -// Report known formats. -foreach($strftimeValues as $format => $value){ +// Report known formats +foreach ($strftimeValues as $format => $value) { echo "Known format : '{$format}' = ", str_pad("'{$value}'", $maxValueLength), " ( {$strftimeFormats[$format]} )\n"; } -// Report unknown formats. -foreach(array_diff_key($strftimeFormats, $strftimeValues) as $format => $description){ +// Report unknown formats +foreach (array_diff_key($strftimeFormats, $strftimeValues) as $format => $description) { echo "Unknown format : '{$format}' ", str_pad(' ', $maxValueLength), ($description ? " ( {$description} )" : ''), "\n"; } + ?> ]]> diff --git a/reference/errorfunc/functions/trigger-error.xml b/reference/errorfunc/functions/trigger-error.xml index b8b165860..5201fc022 100644 --- a/reference/errorfunc/functions/trigger-error.xml +++ b/reference/errorfunc/functions/trigger-error.xml @@ -1,7 +1,7 @@ - - + + trigger_error @@ -39,7 +39,7 @@ error_level - 该 error 所特定的错误类型。仅 E_USER 系列常量对其有效,默认是 E_USER_NOTICE。 + 该 error 所特定的错误类型。仅 E_USER_* 系列常量对其有效,默认是 E_USER_NOTICE