Alibabacloud.com offers a wide variety of articles about date 22 weeks ago from today, easily find your date 22 weeks ago from today information here online.
Local Test Cases:
# there can be no spaces on either side of the equal sign, before the error has been out here
yesterday= ' date-d last-day +%y-%m-%d '
echo $yesterday
curday= ' Date +%y-%m-%d '
echo $curday
echo "Now time: ' Date ' +%y%m%d%T '"
MySQL yesterday a week ago a year ago the data here mainly used in the date_sub,Refer to the followingThe code is as follows:SELECT * from Yh_contentwhere Inputtime>date_sub (Curdate (), INTERVAL 1 day)where Inputtime>date_sub (Curdate (), INTERVAL 1
PHP date query function code
Date_default_timezone_set ('prc'); // Default time zone
Echo "today:", date ("Y-m-d", time ()),"";
Echo "today:", date ("Y-m-d", strtotime ("18 Jun 2008 ")),"";
Echo
MySQL data from a year ago a week ago yesterday the main use of date_sub,
Refer to the following
Copy Code code as follows:
SELECT * from Yh_content
where Inputtime>date_sub (Curdate (), INTERVAL 1 day)
where Inputtime>date_sub
Get the date of the dayDate +%y-%m-%dOutput: 2011-07-28Assigns the current date to a date variabledate=$ (Date +%y%m%d)Sometimes we need to use dates before or after today, so we can use the-D parameter of dateGet Tomorrow's dateDate-d Next-day
Use the function date () to implement the displayed in the format: year-month-day hours: minutes: secRelated Time parameters:A-"AM" or "PM"A-"AM" or "PM"D-A few days, two digits, if less than two digits before the 0; such as: "01" to "31"D-Days of
Get the date of the dayDate +%y-%m-%dOutput: 2011-07-28Assigns the current date to a date variabledate=$ (Date +%y%m%d)Sometimes we need to use dates before or after today, so we can use the-D parameter of dateGet Tomorrow's dateDate-d Next-day
The simple use of Date and Time Processing Package Carbon in Laravel, laravelcarbon
Preface
We often need to process the date and time when writing PHP applications. This article will show you how to extend the Carbon-inherited API extensions from
Direct run will show time[Email protected] shell]# Datesat APR 12:56:47 CST 2016View Calendar[[email protected] shell]# cal April 2016Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 910 11 12 13 14 15 1617 18 19 20 21 22 2324 25 26 27 28 29 30View a full year[[
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.