Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/date i18n


Retrieve the date in localized format, based on timestamp.

If the locale specifies the locale month and weekday, then the locale will take over the format for the date. If it isn't, then the date format string will be used instead.

i18n is an abbreviation for Internationalization. (There are 18 letters between the first "i" and last "n".)


<?php echo date_i18n$dateformatstring$unixtimestamp$gmt ); ?>


(string) (required) Format to display the date.
Default: None
(integer) (optional) Unix timestamp.
Default: false
(boolean) (optional) Whether to convert to GMT for time.
Default: false

Return Values

The date, translated if locale specifies it.


Depending on your blog settings you will see the date displayed in your local format, for example: 15. november 1976.

 <?php echo date_i18n( get_option( 'date_format' ), strtotime( '11/15-1976' ) ); ?>


Change Log

  • Since: 0.71

Source File

date_i18n() is located in wp-includes/functions.php.


L10n: translate(), __(), _e(), _n(), _x(), _ex(), _nx(), esc_attr__(), esc_attr_e(), esc_attr_x(), esc_html__(), esc_html_e(), esc_html_x(), _n_noop(), _nx_noop(), translate_nooped_plural()

See also index of Function Reference and index of Template Tags.