スキップしてメイン コンテンツに移動

sitemap.xml の lastmod で日付のエラーがでた。ファイルのタイムスタンプにも注意!

sitemap.xmlに記載しているlastmodに「日付の値が無効です。 日付または書式設定を修正してから、再送信してください。」というエラーが出ていた。

lastmodはファイルの更新日を標記するタグ

フォーマットはW3C Datetime形式で記述する必要があるそうだ。省略してYYYY-MM-DDでも標記できるとある。

W3Cではこう書いてある。

Formats

Different standards may need different levels of granularity in the date and time, so this profile defines six levels. Standards that reference this profile should specify one or more of these granularities. If a given standard allows more than one granularity, it should specify the meaning of the dates and times with reduced precision, for example, the result of comparing two dates with different precisions.
The formats are as follows. Exactly the components shown here must be present, with exactly this punctuation. Note that the "T" appears literally in the string, to indicate the beginning of the time element, as specified in ISO 8601.
   Year:
      YYYY (eg 1997)
   Year and month:
      YYYY-MM (eg 1997-07)
   Complete date:
      YYYY-MM-DD (eg 1997-07-16)
   Complete date plus hours and minutes:
      YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)
   Complete date plus hours, minutes and seconds:
      YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
   Complete date plus hours, minutes, seconds and a decimal fraction of a
second
      YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)
where:
     YYYY = four-digit year
     MM   = two-digit month (01=January, etc.)
     DD   = two-digit day of month (01 through 31)
     hh   = two digits of hour (00 through 23) (am/pm NOT allowed)
     mm   = two digits of minute (00 through 59)
     ss   = two digits of second (00 through 59)
     s    = one or more digits representing a decimal fraction of a second
     TZD  = time zone designator (Z or +hh:mm or -hh:mm)
This profile does not specify how many digits may be used to represent the decimal fraction of a second. An adopting standard that permits fractions of a second must specify both the minimum number of digits (a number greater than or equal to one) and the maximum number of digits (the maximum may be stated to be "unlimited").
This profile defines two ways of handling time zone offsets:
  1. Times are expressed in UTC (Coordinated Universal Time), with a special UTC designator ("Z").
  2. Times are expressed in local time, together with a time zone offset in hours and minutes. A time zone offset of "+hh:mm" indicates that the date/time uses a local time zone which is "hh" hours and "mm" minutes ahead of UTC. A time zone offset of "-hh:mm" indicates that the date/time uses a local time zone which is "hh" hours and "mm" minutes behind UTC.
A standard referencing this profile should permit one or both of these ways of handling time zone offsets.

Examples

1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time.
1994-11-05T13:15:30Z corresponds to the same instant.
 間違っていないのになんでエラーなんだろうか?
もしかしたら、サーバーが返す、「If-Modified-Sinceヘッダ」が違う日付を返しているのだろうか?
など、いろいろ考えてみましたが、sitemap.xmlのタイムスタンプを更新したら解決しました。

コメント

このブログの人気の投稿

Mac OS X エラーコード 8076

MacOS X 10.9で、ファイルの名称変更を行ったところ、エラーコード8076が表示され、変更ができない事象が発生しました。 どうやら、別プロセスで大容量のファイルをファイルサーバーにコピーしていたのが、影響したようで、このコピーが完了したら、無事ファイル名が変更できる様になりました。

うわさの公式

社会心理学者のG.W.オルポート、L.ポストマンがその著作 「デマの心理学」で語ったのが、「噂の公式」なる数式。 岩波書店から日本語訳で出版されたのが1952年であり かなり古いものになりますが、改めて見ると興味深いものです。 ● 噂の公式: R=i×a R : Rumor (噂の流通量) i : importance (その情報の重要性) a : ambiguity (その情報の曖昧さ) 噂がどの規模まで流通(伝達)されるかは、 伝達者にとっての、その情報の重要性と、 情報内容の曖昧さの「積」によって決定されるというもの。