date_i18n WordPress Filter Hook

The date_i18n hook allows you to internationalize dates in WordPress. This hook is similar to the date() function in PHP, but allows you to specify a timezone and language.

apply_filters( 'date_i18n', string $date, string $format, int $timestamp, bool $gmt ) #

Filters the date formatted based on the locale.


Parameters

$date

(string)Formatted date string.

$format

(string)Format to display the date.

$timestamp

(int)A sum of Unix timestamp and timezone offset in seconds. Might be without offset if input omitted timestamp but requested GMT.

$gmt

(bool)Whether to use GMT timezone. Only applies if timestamp was not provided. Default false.


Top ↑

Source

File: wp-includes/functions.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More