Search Central Live is coming to New York City on March 20, 2025! Learn more and
apply for an invite.
Using the lastmod attribute
April 14, 2006
With our
recent infrastructure changes,
we've made some minor changes in how we process the
lastmod attribute.
If you omit the time portion, it defaults to midnight UTC (00:00:00Z). If you specify a time, but
omit the timezone, you'll get an invalid date error. You'll also get an invalid date error if you
specify an invalid date or time (like February 80th) or the date isn't in the correct format.
You'll no longer see errors associated with future dates.
Dates must use
W3C Datetime encoding,
although you can omit the time portion. For instance, the following are both valid:
- 2005-02-21
- 2005-02-21T18:00:15+00:00
Posted by Vanessa Fox
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
[null,null,[],[[["Google Search now defaults the lastmod attribute's time portion to midnight UTC if omitted and requires a timezone if a time is specified."],["Invalid date or time formats, including invalid dates (like February 80th) and incorrect formatting, will result in an error."],["Google Search now accepts W3C Datetime encoding for the lastmod attribute, allowing for date-only or full date and time with timezone specifications."],["Errors associated with future dates in the lastmod attribute will no longer be displayed."]]],["Recent infrastructure changes have led to updates in processing the `lastmod` attribute. Omitting the time in `lastmod` now defaults to midnight UTC. Specifying a time without a timezone, providing an invalid date/time, or using an incorrect format will result in an error. Future dates will no longer generate errors. Dates must adhere to W3C Datetime encoding, but the time portion is optional, with examples of valid formats provided.\n"]]