Skip to content

Instantly share code, notes, and snippets.

@johnabela
Created April 21, 2019 16:02
Show Gist options
  • Save johnabela/14e27b598629217c450c4f99e31e5184 to your computer and use it in GitHub Desktop.
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