Skip to content

Instantly share code, notes, and snippets.

@johnabela
Created April 21, 2019 16:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save johnabela/14e27b598629217c450c4f99e31e5184 to your computer and use it in GitHub Desktop.
A nice php one-liner to return a formated date of whatever today is, minus one week.
$TodayMinusOneWeek = (new DateTime())->modify('-1 week')->format('Y-m-d');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment