Checkdate: Verify the correctness of the date.
Date: Formats the time of the server.
Strftime: The time of the server is formatted locally.
GETDATE: Get time and date information.
Gettimeofday: Get the current time.
Gmdate: Gets the current time
1.UNIX time StampPHPD processing data, especially when the time type data in the database is formatted, it is necessary to convert the time type data into the UNIX timestamp for processing. Different database systems for time-type data
cannot be
In many cases, in order to display the timely information, the time is usually displayed as just five minutes ago, three hours ago, rather than printing the time directly. For Weibo, SNS applications use this function for the longest time. In
In the actual work we also need to often use the specified time to generate
For example, you need to find a registered user yesterday to this moment.
We need to do two things:
Gets the current time of the Unix timestamp. Use
Programmers who have written PHP + MySQL know that there is a time difference. UNIX timestamps and formatting dates are two forms of time representation that we often deal with. The Unix timestamps are easy to store and process, but not intuitive,
Analysis of php time function usage and php function usage
This example describes the usage of php time functions. We will share this with you for your reference. The details are as follows:
Functions related to unix timestamps in php are easy to
This article will describe how to implement a time conversion based on the timeline.
First we need to understand several functions of time:
Time (): Returns the current Unix timestamp
Date (): Formats a local time/date.
Application Examples:
Strtotime can parse the date-time description of any English text into a Unix timestamp, we use the mktime () or date () format date time to get the specified timestamp to achieve the required DateTime.
implementation function : Gets the timestamp
SQLite database processing time problem and date time functionfirst of all, the SQLite database in time processing and SQL Server also has a different oracle, the following according to their own examples summarized. A log data table was
The PHP strtotime function resolves the date-time description of any English text to a UNIX timestamp [converts system time to UNIX timestamp]
First, get the Unix timestamp strtotime ("2009-1-22″" example) for the specified date as follows:
Echo
Here are some of the time functions in PHP:(1) DateUsage: Date (format, [time]);If there is no time parameter, the current time is used. The format is a string in which the following characters have special meanings:U is replaced by the number of
Based on common functions in PHP. Array_change_key_case-array array_chunk whose return string key names are all lowercase or uppercase-split an array into multiple array_combine-create an array, returns an array with the array value array_change_key_
PHPCodeBase: displays the time as "just", "n minutes ago", and so on. In many cases, in order to display the timely information, the time is usually displayed as just five minutes ago, three hours ago, rather than printing the time directly. For
PHPCodeBase: display the time as & amp; quot; n minutes ago &. In many cases, in order to display the timeliness of information, the time is usually displayed as "just", "5 minutes ago", "3 hours ago", and so on, instead of printing the time
PHP: time (), date (), mktime () date and time function libraries are often forgotten. here, you can add them to your favorites for convenience: checkdate: to verify the correctness of the date.
Date: format the server time.
Strftime: format the
UEditor (php) github downloaded from the official website. comwiduuqiniu_ueditor_1.4.3 by default, all files saved are saved in a directory. How can I set the save by month directory? How can I write this? Thank you {code ...} download from the
When we post, comment on the forum, or use QQ space to publish the blog, Weibo, we will see the published content after the time displayed as "just", "5 minutes Ago", "Yesterday 10:23", and not directly display the specific date and time.
This
System files: In development we sometimes need to know the last access time of the file and the last modified time of the file, and introduce the 3 functions that PHP provides to determine the access, creation, and last modification time of the file:
[PHP] function 4 // output the PHP and current request information page
Int phpinfo (void)
// Returns the current PHP version.
String phpversion (void)
// Print out a list of people contributing to this PHP project
String phpcredits (void)
//
A php page cache class
/* $ Cache = new Cache ("../cache/", 20); // Constructor to create a cache class object
$ Cache-> PutCache (); // reverse cache
*/
Class Cache
{
Private $
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.