input:
Output:
jan-05-2002
feb-01-2002
jan-01-2001
jan-01-1999
Strtotime functionthe Strtotime () function resolves the date-time description of any English text to a Unix timestamp.Syntax:strtotime (time,now) Parameter Description time to specify the string to parse.Now is the
: l--English week d--Week
The control character that represents the hour: h--from 1-12 hours h---from 0 to 23 hours
Represents the control character a---am or pm a---am or PM in the afternoon
The control character that represents the minute: I---Take a value of 00-59
Another z--date of the year
2. Array getdate (integer timestamp)
The function returns a matrix.
Such as:
?
$current _date=getdate ();
Print ($current _date ("hours"));
Print ($current _da
day of the year
4. Otherecho Date (' T ');UtcCapital T indicates the time zone setting of the server
echo Date (' I ');0Capital I indicates whether the current is daylight saving time, returns 1 for true, or 0
echo Date (' U ');1170769424The capital U represents the tota
First, let's start by saying what the shell timestamp is:The number of seconds since January 1, 1970 (00:00:00 utc/gmt). It is also known as the Unix timestamp (Unix timestam, Unix epoch, POSIX time, Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (Midnight of Utc/gmt), regardless of the leap seconds.The Unix timestamp of 0 according to the ISO 8601 specification is: 1970-01-01t00:00:00z One hours is expressed as a UNI
Date-time functions are a core part of PHP. These functions can be used without installation. The specific use of the date function is described in detail below:
PHP Date () functionThe PHP date () function formats the timestamp as a da
strtotime ("2009-1-22") Results: 1232553600Description: Return January 22, 2009 0:0 0 seconds timestamp
Second, get the English text date and time examples are as follows:Easy to compare, use date to convert time stamp to system time
PHP Date and time
PHP Multidimensional Arrays
PHP Include
The PHP date () function is used to format dates or times.
PHP Date () function
The PHP date () function formats the timestamp as an easier-to-read date and
, typical values are from 2147483648 to 2147483647.Example:
Show:
Array ([seconds] = 45[minutes] [52[hours] = 14[mday] [24[wday] = 2[mon] = 1[year] = 2006[yday ] [= 23[weekday] = Tuesday[month] = january[0] + 1138110765)
Example 2:
Show:
Wednesday, January 25, 2006
Seven:The gettimeofday () function returns an array containing the current time information.The meaning of the returned array key is:"SEC"-number of seconds since the Unix era"USEC"-Numbe
represents the day of the week, the number form representsCapital W indicates the number of weeks in a yearecho Date (' t ');This month is 28 daysecho Date (' Z ');Today is the 36th day of the year.
Lowercase T represents the current month and how many daysLowercase Z means today is the first day of the year
4, other
The code is as follows
Copy Code
echo
The date () function is one of the dates that we often encounter and use in PHP development, and let me introduce some basic dress and method of the date () function, with friends who need to know to enter the reference.
Date-time functions are a core part of PHP. These functions can be used without installation. The s
The date () function is one of the dates that we often encounter and use in PHP development, let me introduce some basic dress and method of date () function, and have a friend who needs to know to enter into the referenceDate-time functions are a core part of PHP. These functions can be used without installation. The specific use of the
Processing techniques for date and time
The concept of time in PHPUnix time stampProcessing of dates and times
1. PHP Time Concept
In the PHP language, date and time functions depend o
Spit Groove
Java 8 provides a new set of date-time APIs, why do you do so? Because in the old Java, the date time API has many problems, such as thread safety issues , java.util.Date is not thread-safe, all date classes are variable; and the design is messy , You go to see
current timestamp:The first method:var timestamp =date.parse (New Date ());Results: 1280977330000The second method:var timestamp = (new Date ()). valueof ();Results: 1280977330748The third method:var timestamp=new Date (). GetTime ();Results: 1280977330748the first: the timestamp obtained is to change the milliseconds to 000 display,The second and third are to o
simple timeThe following characters are commonly used for time:
H-12 hour format with first zero
I-minutes with first zero
S-Seconds with First zero (00-59)
A-lowercase noon and afternoon (AM or PM)
The following example outputs the current time in the specified format:InstancePHP Echo Date ("H:i:sa");? >Note: Be aware that the PHP
present, which is the Unix time stamp for the Unix time era.
echo Date (' C ');
2007-02-06t14:24:43+00:00
Lowercase C represents the ISO8601 date, the date format is YYYY-MM-DD, the date
$timestamp Timestamp required parameter, the following three parameters are optional, in order to improve the speed of calculation, it is recommended to directly assign value* @param $now Current timestamp* @param $today today 00:00 time stamp* @param $yesterday yesterday 00:00 time stamp* @return String*/function Tim
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.