-1

なぜこれが起こっているのか分かりません

echo date('l F y',strtotime('next Tuesday',time())) . "\n";
echo date('l F y',strtotime('next Wednesday',time())) . "\n";
echo date('l F y',strtotime('next Thursday',time())) . "\n";
echo date('l F y',strtotime('next Friday',time())) . "\n";

私にくれます

Tuesday October 12
Wednesday October 12
Thursday October 12
Friday October 12

なんで?

4

4 に答える 4

6

曜日、月、年の最後の2桁を出力するように要求しています。これは、実行していることです。

日付形式の文字とその意味のリストについては、こちらをご覧ください。

于 2012-10-24T06:32:10.440 に答える
3

@jrdnが言ったyように、これは1年なので、次の火曜日の年などを取得します。

日付については、これを使用してください:

echo date('l F d',strtotime('next Tuesday',time())) . "\n";
echo date('l F d',strtotime('next Wednesday',time())) . "\n";
echo date('l F d',strtotime('next Thursday',time())) . "\n";
echo date('l F d',strtotime('next Friday',time())) . "\n";

出力:

Tuesday October 30
Wednesday October 31
Thursday October 25
Friday October 26
于 2012-10-24T06:35:01.967 に答える
0

dフォーマットを追加するとより明確になると思います

echo date('d l F y',strtotime('next Tuesday',time())) . "\n";
echo date('d l F y',strtotime('next Wednesday',time())) . "\n";
echo date('d l F y',strtotime('next Thursday',time())) . "\n";
echo date('d l F y',strtotime('next Friday',time())) . "\n";

o/pになります

30 Tuesday October 12 // next tuesday date since this week tuesday has already passed
31 Wednesday October 12 // next wed date since this week wed has already passed
25 Thursday October 12 // next thur date since this week thur is yet to pass
26 Friday October 12 // next fri date since this week fri is yet to pass

date()についてもっと読む

于 2012-10-24T06:38:11.793 に答える
0

これをチェックしますか?

<?php
$nexTuesday = date('l F y',strtotime('next Tuesday',time())) . "\n";
$nextWednesday = date('l F y',strtotime('next Wednesday',time())) . "\n";
$nextThursday = date('l F y',strtotime('next Thursday',time())) . "\n";
$nextFriday = date('l F y',strtotime('next Friday',time())) . "\n";

//Lets make date to time

$nexTuesday = strtotime($nexTuesday);
$nextWednesday = strtotime($nextWednesday);
$nextThursday = strtotime($nextThursday);
$nextFriday = strtotime($nextFriday);

//If you have need for this, then echo the timestamp as 'l F y' like this:

echo date('l F y',$nextFriday);
?>
于 2012-10-24T06:41:17.933 に答える