EspañolDeutschFrançaisItalianoPortuguêsРусскийΕλληνικά日本語中文(简体)हिन्दी; हिंदीالعربية
既定の言語として設定します。
PF の質問 - フォーラム

PHP で別の 1 つの形式から日付を変換します。

PHP で別の日付形式に、日付の形式を変換する簡単な方法があります。?

私はこれがあります。:

何が間違っています。?

Share on Facebook Tweet about this on Twitter Share on Google+ Pin on Pinterest Share on Reddit Share on VK Share on StumbleUpon Share on Tumblr Share on LinkedIn Email this to someone Print this page
ピーター枯 聞かれるは 7 年
1 回答
最高の答え

2 番目のパラメーターに渡すこと 日付() 適切なパラメーターをする必要があります。, すなわち, 秒数、 1 1 月に 1970. それを渡す文字列は認識しません。.

それを使用してください。 strtotime() 日付文字列を変換するため、 タイムスタンプ, いないが strtotime() 認識されます。 y-m-d-h-i-s.

PHP 5.3 以下

使用 DateTime::createFromFormat. 構文を使用して正確なマスクを指定することができます。 日付() 受信日付を分析するには.

PHP 5.2 以前

項目をスキャンする必要があります。 (年, ヶ月, 日, 時間, 分, 2 番目) substr を使用してください。() 結果を渡すと mktime () タイムスタンプを構築するには.

多くの仕事! 私は異なる形式を使用してお勧めします strtotime() 知っておくべきこと. これを試してください。:

Share on Facebook Tweet about this on Twitter Share on Google+ Pin on Pinterest Share on Reddit Share on VK Share on StumbleUpon Share on Tumblr Share on LinkedIn Email this to someone Print this page
コーダー いう 7 年