Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php get start and end date of month and year

<?php

$query_date = '2010-02-04';

// First day of the month.
echo date('Y-m-01', strtotime($query_date));

// Last day of the month.
echo date('Y-m-t', strtotime($query_date));
Comment

php get end date of month

// First date of the month.
$monthFirstDate = date('Y-m-01', strtotime('today'));

// Last date of the month.
$monthLastDate = date('Y-m-t', strtotime('today'));

// Second last date of the month
$monthLastSecondDate = date('Y-m-d', strtotime('-2 day', strtotime('today')));
Comment

php date start of day

$startOfDay=date("Y-m-d 00:00:00");
Comment

php date first day of month and last month

$first = date('Y-m-01', strtotime('last month'));
$last = date('Y-m-t', strtotime('last month'));
Comment

php extract month and year from date

$time=strtotime($dateValue);
$month=date("F",$time);
$year=date("Y",$time);
Comment

php extract month and year from date

$time=strtotime($dateValue);
$month=date("F",$time);
$year=date("Y",$time);
Comment

PREVIOUS NEXT
Code Example
Php :: php ping time 
Php :: magento 2 change customers password 
Php :: laravel controller return message 
Php :: full name validation laravel 
Php :: pause php 
Php :: check exist string in string php 
Php :: get domain from subdomain php 
Php :: rollback laravel transaction 
Php :: behamin bresource collection 
Php :: magento 2 status mode 
Php :: xml to object php 
Php :: wordpress query orderby name 
Php :: php create 404 error 
Php :: counting a string in php 
Php :: php copy url 
Php :: Making visible or hidden attributes from Eloquent temporarily 
Php :: validate audio file in laravel 
Php :: wordpress check if page 
Php :: wordpress disable theme editor 
Php :: get the href in string regex php 
Php :: php add year to date 
Php :: if post id is wordpress php 
Php :: link js file in php 
Php :: $posts- links() laravel design error 
Php :: override Telescope in laravel 
Php :: foreach range php 
Php :: php get content phpinfo without show 
Php :: php parse json 
Php :: codeigniter 3 Configured database connection has cache enabled 
Php :: php loop through months 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =