Search
 
SCRIPT & CODE EXAMPLE
 

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'));
Comment

PREVIOUS NEXT
Code Example
Php :: create view from route laravel 
Php :: laravel unique validation 
Php :: remove whitespace from string php 
Php :: laravel required_with 
Php :: docker check php version 
Php :: php get url 
Php :: setinterval php 
Php :: use ternary operator as null coalescing operator in php 
Php :: how-to-call-ajax-in-wordpress 
Php :: laravel redirect back with errors and input 
Php :: php cli display errors 
Php :: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known 
Php :: woocommerce get post meta 
Php :: how to use where relationship laravel 
Php :: install php 8 ubuntu 
Php :: Deleting an element from an array in PHP 
Php :: use latest with first in laravel eloquent 
Php :: PHP (WordPress) - Increase Maximum Upload File Size 
Php :: php date from format 
Php :: php float round 
Php :: Larvel Print last query 
Php :: php random number generator 
Php :: getMessage in php 
Php :: laravel drop table column 
Php :: use model from variable laravel 
Php :: Undefined index: id 
Php :: $conn-query("SET NAMES utf8"); 
Php :: show data from a table in laravel 8 
Php :: wc php get product permalink 
Php :: create project laravel 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =