iOS is often used to show code snippets a few hours ago/days ago/months ago/years ago2015-03-13 10:09copyright Notice: Please pay attention to personal blog: http://www.henishuo.com/print?
/**
* Retain a formated string with a real date
Save the following instance code as time.phpDelete
The code is as follows
Copy Code
Test code:$time 1 = time ()-60 * 60 * 23;Echo Formattime ($time 1, 1); Result: 23 hours agoecho "";$time 2 = ' 2013-11-11 19:16:12 ';
Js implementation time shows a collection of methods several days ago, several hours ago, or a few minutes ago, js a few days ago
Here we summarize common methods for displaying the js implementation time several days ago, several hours ago, or
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 '"
This article mainly introduces several functions and classes of php computing several minutes ago, several hours ago, and a few days ago. For more information, see
This article mainly introduces several functions and classes of php computing several
Php converts the date format to the format before xx days, and the php format to the format before xx days. Php converts the date format to the format before xx days. the example in this article describes how php converts the date format to the
PHP converts time to several functions and classes several minutes ago, several hours ago, and a few days ago. This article mainly introduces several functions of php computing several minutes ago, several hours ago, and a few days ago., class
This article mainly introduces PHP calculation time a few ago, a few hours ago, a few days ago several functions, class sharing, the need for friends can refer to the next
First, the function realization
Example 1:
Example 2:
Example 3
Known Date: 2013-07-31 plus 12 months 3 months 1 months get the appropriate date
How can daniel write php code?
Reply to discussion (solution)
!--? php $date 1 = "2006-08-09"; Echo Date (' y-m-d ', Strtotime ("$date 1 +5 Day")), or,
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.