简体   繁体   中英

php strtotime thursday not working

I have php functions to get dates from this and next week. All is good except thursday - output from thursday is empty.

Here is my code:

$pondeli1 = date( 'd.m.Y', strtotime( 'monday this week' ) );
$utery1 = date( 'd.m.Y', strtotime( 'tuesday this week' ) );
$streda1 = date( 'd.m.Y', strtotime( 'wednesday this week' ) );
$ctrvtek1 = date( 'd.m.Y', strtotime( 'thursday this week' ) );
$patek1 = date( 'd.m.Y', strtotime( 'friday this week' ) );

$pondeli2 = date( 'd.m.Y', strtotime( 'monday next week' ) );
$utery2 = date( 'd.m.Y', strtotime( 'tuesday next week' ) );
$streda2 = date( 'd.m.Y', strtotime( 'wednesday next week' ) );
$ctrvtek2 = date( 'd.m.Y', strtotime( 'thursday next week' ) );
$patek2 = date( 'd.m.Y', strtotime( 'friday next week' ) );

And lines with "thursday next week" are not returning anything...

Where is problem please?

尝试使用

$ctrvtek2 =strtotime("next Thursday",$ctrvtek1);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM