/ JSON Checker Fixes / Schema Dates

How to Fix Schema Date Errors

Schema.org dates must be ISO 8601 — anything else gets silently ignored by Google. A common mistake is templates that output localised date strings ("January 15, 2024") into JSON-LD instead of the YYYY-MM-DD format. Article freshness signals, event scheduling, offer validity all depend on parseable dates. This guide covers the date format, datePublished vs dateModified distinctions, time zone handling, and the CMS-level fixes that prevent recurrence.

1. The ISO 8601 format

Schema.org's Date and DateTime types both require ISO 8601:

// Date-only (no time)
"2024-01-15"

// Full timestamp with UTC
"2024-01-15T14:30:00Z"

// Full timestamp with time-zone offset
"2024-01-15T14:30:00+00:00"
"2024-01-15T09:30:00-05:00"  // US Eastern

// INVALID
"January 15, 2024"
"15/01/2024"
"2024-1-15"      // missing zero-padding
"2024-01-15 14:30"  // space instead of T
"2024-01-15T14:30"  // missing seconds and TZ

2. Audit current dates

Step 1
Run the JSON Checker
Findings include the page URL, the offending field, and the bad value. Group by source — typically all from one or two templates.
Step 2
Common error patterns
  • Localised format: "January 15, 2024" — caused by templates outputting strftime("%B %d, %Y") into JSON
  • DD/MM vs MM/DD ambiguity: "01/02/2024" — never use this in schema
  • Mixed format: some pages ISO, some not — different code paths
  • Future-dated: dateModified in 2026 when current date is 2025 — bug in template
  • Empty string: "datePublished": "" — CMS field not set

3. Fix at the data layer

Templates shouldn't format dates. Pass ISO strings from the data layer into the template as-is.

WordPress

// functions.php or schema plugin
$schema = [
  '@type' => 'Article',
  'datePublished' => get_the_date('c', $post),  // 'c' is ISO 8601
  'dateModified' => get_the_modified_date('c', $post),
];

The 'c' format token outputs ISO 8601 with time zone offset.

Liquid (Shopify, Jekyll)

{% assign date_iso = article.published_at | date: '%Y-%m-%dT%H:%M:%S%z' %}
"datePublished": "{{ date_iso }}"

JavaScript / Node

// Use Date.toISOString() for UTC
{
  "datePublished": article.publishedAt.toISOString()  // 2024-01-15T14:30:00.000Z
}

// Or date-fns formatISO()
import { formatISO } from 'date-fns';
{
  "datePublished": formatISO(article.publishedAt)
}

Python (Django, Flask)

from datetime import datetime, timezone
article.published_at.isoformat()  # 2024-01-15T14:30:00+00:00

# Django template filter
{{ article.published_at|date:"c" }}

4. datePublished vs dateModified

datePublished

dateModified

⚠️ Some sites set dateModified to today on every page load to game "freshness". Google detects this and may apply penalties. Only update dateModified when content genuinely changes.

5. Time zones

Pick a strategy

What you can't do: mix. Some pages UTC, others site-local, creates temporal inconsistency.

Store in UTC, display in local

// Database: stored as UTC
publishedAt: 2024-01-15T14:30:00Z

// Schema output: UTC
"datePublished": "2024-01-15T14:30:00Z"

// HTML display: user's local time via JS
<time datetime="2024-01-15T14:30:00Z">15 January 2024</time>

6. Event and Offer dates

Similar rules apply to startDate, endDate (Event), priceValidUntil (Offer), validFrom (various).

// Event with start and end
{
  "@type": "Event",
  "startDate": "2025-06-15T19:00:00+01:00",
  "endDate": "2025-06-15T22:00:00+01:00",
  "eventStatus": "https://schema.org/EventScheduled"
}

// Offer with expiry
{
  "@type": "Offer",
  "price": "29.99",
  "priceCurrency": "USD",
  "priceValidUntil": "2025-12-31",
  "availability": "https://schema.org/InStock"
}

Past priceValidUntil dates trigger Google warnings — "Offer expired". Update the date or remove the field for ongoing offers.

7. Validate the fix

Step 1
Schema.org validator
validator.schema.org reports invalid date formats specifically. After fixes, every date should parse cleanly.
Step 2
Google Rich Results Test
Catches date errors specific to rich-result eligibility — Article needs both dates, Event needs start, Offer needs validity. Findings show "Missing field" or "Invalid format".
💡 Set up a unit test: parse every JSON-LD date in every page through a strict ISO 8601 parser. Failing tests block deploy. Catches regressions before they ship; the test is trivial to write and runs in seconds.

📋 Re-run the JSON Checker

Verify date format errors are cleared.

Run JSON Checker →
Related Guides: JSON Checker Fixes  ·  Fix Required Fields  ·  Fix Schema Types  ·  JSON Checker Guide
💬 Got a problem?