wp-locale-and-dates
Installation
SKILL.md
WordPress Locale, Dates & Numbers
WP's date/time API has TWO eras: pre-5.3 (offset-summed timestamps, date_i18n, current_time('timestamp') — quirky, error-prone) and 5.3+ (true UTC timestamps, DateTimeZone objects, wp_date, current_datetime). Most plugins still write pre-5.3 code because that's what AI training data is full of. This skill is the modern recipe.
When to use this skill
Trigger when ANY of the following is true:
- A plugin stores, queries, or displays dates / times — scheduled tasks, expiry dates, audit timestamps, log entries, "X minutes ago" labels, REST date fields.
- Code references
wp_date,current_datetime,current_time,date_i18n,wp_timezone,wp_timezone_string,get_gmt_from_date,get_date_from_gmt,mysql2date,mysql_to_rfc3339,iso8601_to_datetime,number_format_i18n. - Code calls
time(),date(),strtotime()directly for site-display dates without considering timezone. - The user reports: "wrong timezone on schedule emails", "WP-Admin shows EST but database has UTC", "Friday in Europe shows as Thursday in REST".
The mental model — timestamps are UTC, formatting is local
Since WP 5.3, the rule is: