<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>takafumi-s</author_name>
  <author_url>https://blog.hatena.ne.jp/takafumi-s/</author_url>
  <blog_title>takafumi blog</blog_title>
  <blog_url>https://takafumi-s.hatenablog.com/</blog_url>
  <categories>
    <anon>php</anon>
  </categories>
  <description>環境 CentOS 7.0 PHP 5.6 以外とよく聞かれる、日付形式「yyyy-mm-dd hh:ii:ss」が正しいかチェックする方法。 &lt;?php function checkDatetimeFormat($datetime){ return $datetime === date(&quot;Y-m-d H:i:s&quot;, strtotime($datetime)); } 正規表現で書く人が多いが、こちらの方が書くのも楽だし可読性もよい。 またdate()のフォーマットを変えれば、別の形式の場合も簡単にチェックできる。 正規表現だと &lt;?php function checkDatetimeForma…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakafumi-s.hatenablog.com%2Fentry%2F2015%2F06%2F06%2F192443&quot; title=&quot;PHPで日付フォーマットのチェック。 - takafumi blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2015-06-06 19:24:43</published>
  <title>PHPで日付フォーマットのチェック。</title>
  <type>rich</type>
  <url>https://takafumi-s.hatenablog.com/entry/2015/06/06/192443</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
