Changeset 60119
- Timestamp:
- 04/01/2025 04:41:05 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r60085 r60119 71 71 * @since 5.3.0 Now returns an integer if `$type` is 'U'. Previously a string was returned. 72 72 * 73 * @param string 74 * 75 * @param int|bool$gmt Optional. Whether to use GMT timezone. Default false.73 * @param string $type Type of time to retrieve. Accepts 'mysql', 'timestamp', 'U', 74 * or PHP date format string (e.g. 'Y-m-d'). 75 * @param bool $gmt Optional. Whether to use GMT timezone. Default false. 76 76 * @return int|string Integer if `$type` is 'timestamp' or 'U', string otherwise. 77 77 */ 78 function current_time( $type, $gmt = 0) {78 function current_time( $type, $gmt = false ) { 79 79 // Don't use non-GMT timestamp, unless you know the difference and really need to. 80 80 if ( 'timestamp' === $type || 'U' === $type ) { … … 217 217 * Might be without offset if input omitted timestamp but requested GMT. 218 218 * @param bool $gmt Whether to use GMT timezone. Only applies if timestamp was not provided. 219 * Default false.220 219 */ 221 220 $date = apply_filters( 'date_i18n', $date, $format, $timestamp, $gmt ); … … 236 235 * @global WP_Locale $wp_locale WordPress date and time locale object. 237 236 * 238 * @param string $format PHP date format.239 * @param int $timestamp Optional. Unix timestamp. Defaults to current time.240 * @param DateTimeZone $timezone Optional. Timezone to output result in. Defaults to timezone241 * from site settings.237 * @param string $format PHP date format. 238 * @param int|null $timestamp Optional. Unix timestamp. Defaults to current time. 239 * @param DateTimeZone|null $timezone Optional. Timezone to output result in. Defaults to timezone 240 * from site settings. 242 241 * @return string|false The date, translated if locale specifies it. False on invalid timestamp input. 243 242 */
Note: See TracChangeset
for help on using the changeset viewer.