Advertisement
topherbones

PHP Date Tricks

Mar 3rd, 2023
664
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. ############################################################################################################
  2. // Get the last day of current or set month
  3. $aDate = "2009-11-23";
  4. echo date("Y-m-t", strtotime($aDate));
  5.  
  6. t = number of days in a month, you want the year, to account for variations, such as a leap year.
  7. ############################################################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement