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.

Signature

date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false )
dateformatstring
 (string) Format to display the date.
unixtimestamp
 (boolean|int) Optional. Unix timestamp. Default false.
Default: false
gmt
 (boolean) Optional. Whether to use GMT timezone. Default false.
Default: false

Return

(string) The date, translated if locale specifies it.

Source

function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) {
	global $wp_locale;
	$i = $unixtimestamp;

	if ( false === $i ) {
		$i = current_time( 'timestamp', $gmt );
	}

	/*
	 * Store original value for language with untypical grammars.
	 * See https://core.trac.wordpress.org/ticket/9396
	 */
	$req_format = $dateformatstring;

	if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) {
		$datemonth = $wp_locale->get_month( date( 'm', $i ) );
		$datemonth_abbrev = $wp_locale->get_month_abbrev( $datemonth );
		$dateweekday = $wp_locale->get_weekday( date( 'w', $i ) );
		$dateweekday_abbrev = $wp_locale->get_weekday_abbrev( $dateweekday );
		$datemeridiem = $wp_locale->get_meridiem( date( 'a', $i ) );
43 more lines...
WP Trac GitHub

Link here