Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php date + 1 year

$today =date('Y-m-d');
$expiryDate=date('Y-m-d H:i:s', strtotime('+1 year', strtotime($today)) );
Comment

php grab year from date

$year = date("y",strtotime($mydate));
Comment

year in php

date('Y')
Comment

php year from date

echo date('Y', $date);
Comment

php get date from day of year

// This should get you a DateTime object from the date and year.
function getDateFromDay($dayOfYear, $year) {
  $date = DateTime::createFromFormat('z Y', strval($dayOfYear) . ' ' . strval($year));
  return $date;
}

// This should get you the day of the year and the year in a string.
date('z Y', strtotime('21 oct 2012'));
Comment

PREVIOUS NEXT
Code Example
Php :: php var_export to string 
Php :: utf8 php 
Php :: php add array values with same keys 
Php :: if notexists in laravel query 
Php :: get text field value in php 
Php :: How do I convert a string to a number in PHP? 
Php :: show data from a table in laravel 8 
Php :: current time input field in laravel form 
Php :: php return a json response 
Php :: codeigniter 3 or where not in 
Php :: laravel collection find duplicates 
Php :: how to send data from one website to another in php 
Php :: how to check php version codeigniter 3 
Php :: import facade URL laravel 
Php :: define function parameters php 
Php :: remove seconds from time php 
Php :: left join laravel 
Php :: how to execute cmd command in php 
Php :: php convert string to boolean 
Php :: laravel fixed character limit 
Php :: curl php 
Php :: wp get tagline 
Php :: collapse open by default 
Php :: in array php multiple values 
Php :: PHP print — Output a string 
Php :: cakephp json response 
Php :: check if date between two dates laravel 
Php :: laravel target class does not exist 
Php :: migration rename column laravel 
Php :: wordpress custom php use wp query 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =