Ec (2); * & nbsp; converts a daytime date to a timestamp & nbsp; strtotime (time, now) parameter description & nbsp; time specifies the time string to be parsed. & Nbsp; now is used to calculate the timestamp of the returned value. If this parameter is omitted, the current time is used. & Nbsp; & lt ;? Php & nbsp; echostrtotime (& quot; now & quot;), & quot; script ec (2); script
/*
Converts a daytime date to a timestamp.
Strtotime (time, now) parameter description
Time specifies the time string to be parsed.
Now is used to calculate the timestamp of the returned value. If this parameter is omitted, the current time is used.
Echo strtotime ("now "),"";
Echo strtotime ("10 September 2000 "),"";
Echo strtotime ("+ 1 day "),"";
Echo strtotime ("+ 1 week "),"";
Echo strtotime ("+ 1 week 2 days 4 hours 2 seconds "),"";
Echo strtotime ("next Thursday "),"";
Echo strtotime ("last Monday "),"";
?>
$ Str = 'Not Good ';
// Previous to PHP 5.1.0 you wowould compare with-1, instead of false
If ($ timestamp = strtotime ($ str) === false ){
Echo "The string ($ str) is bogus ";
} Else {
Echo "$ str =". date ('L dS o f y h: I: s A', $ timestamp );
}
?>
Let's look at the strtotime instance.
*/
Echo strtotime ('2014-2-14 '),"
";
Echo date ('Y-m-d', strtotime ('2017-2-14 '));
// Output value
1266076800
2010-02-14
// You should be in strtotime () and you decide what to do. For example
# On 2/8/2010
Date ('m/d/Y', strtotime ('first Day'); #02/01/10
Date ('m/d/Y', strtotime ('Last Day'); #02/28/10
Date ('m/d/Y', strtotime ('Last day next month'); #03/31/10
Date ('m/d/Y', strtotime ('Last day last month'); #01/31/10
Date ('m/d/Y', strtotime ('2017-12 last Day ')); #12/31/09-this doesn't work if you reverse the order of the year and month
Date ('m/d/Y', strtotime ('2017-03 last Day'); #2009/09
Date ('m/d/Y', strtotime ('2017-03'); #2009/09
Date ('m/d/Y', strtotime ('Last day of march 100'); #2009/09
Date ('m/d/Y', strtotime ('Last day of march'); #03/31/10
?>