Skip to content

Instantly share code, notes, and snippets.

@Krknv
Last active November 28, 2017 12:20
Show Gist options
  • Save Krknv/c925f4456b8575d0e95d02d51dbbf3a8 to your computer and use it in GitHub Desktop.
Save Krknv/c925f4456b8575d0e95d02d51dbbf3a8 to your computer and use it in GitHub Desktop.

#php get last day of given month#

First day:
date("Y-m-d", mktime(0, 0, 0, *YOUR MONTH PARAM*,1 ,date("Y")));

Last day:
date("Y-m-d", mktime(0, 0, 0, *YOUR MONTH PARAM*+1,0,date("Y")));

https://stackoverflow.com/a/33139705/2618535

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment