wp-locale-and-dates

Official

Make WordPress dates and numbers locale-safe.

Authorvikingokft
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Prevents timezone mistakes, broken timestamp conversions, and non-localized date/number output in WordPress plugins—especially when mixing modern 5.3+ helpers with legacy patterns.

Core Features & Use Cases

  • Timezone-correct date/time handling (5.3+): Uses wp_date(), current_datetime(), wp_timezone(), get_gmt_from_date(), and get_date_from_gmt() to ensure UTC storage and correct local rendering.
  • Correct REST date emission: Produces the expected *_gmt conventions and shapes when returning date fields from REST routes.
  • Locale-aware number formatting: Applies number_format_i18n() so displayed digits use the site’s number separators and decimal point.
  • Safe storage strategies: Recommends pairing site-local MySQL DATETIME with UTC *_gmt columns, or using UTC BIGINT integers for event-like fields.
  • Avoids legacy foot-guns: Replaces current_time('timestamp') and date_i18n misuse with modern helpers, and clarifies mysql_to_rfc3339 output behavior.

Quick Start

Use the wp-locale-and-dates skill to refactor your plugin code so it stores UTC consistently, converts site-local inputs at the boundaries, and formats output using wp_date() and number_format_i18n().

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: wp-locale-and-dates
Download link: https://github.com/vikingokft/wp-agent-skills/archive/main.zip#wp-locale-and-dates

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.