Skip to content

Instantly share code, notes, and snippets.

@chardcastle
Created October 15, 2014 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chardcastle/9eff528a8752a05abfac to your computer and use it in GitHub Desktop.
Save chardcastle/9eff528a8752a05abfac to your computer and use it in GitHub Desktop.
DateTime calculator
<?php
var_dump(DateTime::createFromFormat('d-m-Y','01-01-2013')->add(date_interval_create_from_date_string('2 years'))->format('d-m-Y'));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment