pronamic / wp-datetime
WordPress DateTime library.
Installs: 116 957
Dependents: 4
Suggesters: 0
Security: 0
Stars: 3
Watchers: 7
Forks: 1
Open Issues: 0
Type:wordpress-plugin
Requires
- php: >=7.4
Requires (Dev)
- automattic/wordbless: ^0.4.1
- bamarni/composer-bin-plugin: ^1.4
- koodimonni-language/de_de: *
- koodimonni-language/en_gb: *
- koodimonni-language/fr_fr: *
- koodimonni-language/ja: *
- koodimonni-language/nl_nl: *
- overtrue/phplint: ^9.0
- php-coveralls/php-coveralls: ^2.4
- php-stubs/wordpress-globals: ^0.2.0
- phpmd/phpmd: ^2.9
- pronamic/pronamic-cli: ^1.1
- pronamic/wp-coding-standards: ^2.0
- roots/wordpress: ^6.0
- yoast/phpunit-polyfills: ^2.0
README
WordPress Filters
pronamic_datetime_default_format
function prefix_pronamic_datetime_default_format( $format ) { return _x( 'D j M Y \a\t H:i', 'default datetime format', 'pronamic-ideal' ); } add_filter( 'pronamic_datetime_default_format', 'prefix_pronamic_datetime_default_format' );
Note date_i18n
It is important to note that date_i18n()
:
- does not have full feature parity with
date()
, not all formats are supported (such as shorthands); - does not accept Unix timestamp (despite documented to), the expected value is “WordPress timestamp” (offset by time zone);
- has issues with certain timezone settings, such as numerical ones;
- does nothing with
$gmt
argument under normal circumstances;
Any use of this function must be carefully audited for correctness, especially in regards to output of time zones.
Source: https://developer.wordpress.org/reference/functions/date_i18n/#comment-2403