Home > Backend Development > PHP Tutorial > The php date capture I am using

The php date capture I am using

WBOY
Release: 2016-07-25 09:11:11
Original
1040 people have browsed it
I am using php date capture
  1. echo j7_getdate('Y-m-d','2010-11-15','+10 day');
  2. function j7_getdate($format,$time='now',$ opt){
  3. return date("$format",strtotime("$time $opt"));
  4. }
  5. //Output 2010-11-25
  6. //Detailed strtotime usage
  7. /*
  8. echo strtotime(" now"), "n";
  9. echo strtotime("10 September 2000"), "n";
  10. echo strtotime("+1 day"), "n";
  11. echo strtotime("+1 week"), " n";
  12. echo strtotime("+1 week 2 days 4 hours 2 seconds"), "n";
  13. echo strtotime("next Thursday"), "n";
  14. echo strtotime("last Monday"), "n" ";
  15. */
  16. ?>
Copy code


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template