Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

minus 1 year php

$year = new DateTime(date('Y-m-d')); // gets current date
$interval = new DateInterval('P1Y');
$year->sub($interval); // subtract 1 year with $interval

// var_dump($year->format('Y')); or var_dump($year->format('Y-m-d'));
 
PREVIOUS NEXT
Tagged: #year #php
ADD COMMENT
Topic
Name
6+5 =