Created
June 21, 2019 04:51
-
-
Save alandbh/a2678dc4a7936e4416bc11f7bf40cbf0 to your computer and use it in GitHub Desktop.
Wordpress built-in function to display international dates properly.
Retrieve the date in localized format, based on timestamp.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$_evento = get_proximos_eventos(1); | |
$evento = $_evento[0]; | |
$unixtimestamp_inicio = strtotime($evento['data_inicio']); | |
echo date_i18n('M', $unixtimestamp_inicio); // Abril | |
// Depending on your blog settings you will see the date displayed in your local format, for example: 15. november 1976. | |
echo date_i18n( get_option( 'date_format' ), strtotime( '11/15-1976' ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment