// File name: Date. Inc. php3// Before using these two functions, convert the date or date to the timestamp type.// For example:// $ Today = mktime (0, 0, 0, date ("M"), date ("D"), date ("Y "));/***** Simulate the dateadd function in sqlserver *****
Mktime (hour, minute, second, month, day, year, is_dst) is the syntax of mktime. It is not difficult to write a timestamp code at a glance! The following code is a timestamp provided by most people on the Internet. At first glance, it can only be
Mktime (HOUR,MINUTE,SECOND,MONTH,DAY,YEAR,IS_DST) This is mktime syntax, at a glance should not be difficult to write a timestamp code!
The following code is the online most people give the time stamp reality, this one can only say that a look at
In PHP we have to add to the time and date we can use two functions, mktime and strtotime functions, let me give you students to introduce their use methods.
Mktime function
The Mktime () function returns a Unix timestamp for a date.
The parameter
This article describes several common Linux monitoring scripts that can automatically monitor and alert the traffic, system status, disk space, CPU and memory usage of the host Nic. The shell scripts written based on your needs can better meet your
1. View host Nic traffic
Copy codeThe Code is as follows :#! /Bin/bash
# Network
# Mike. Xu
While:; do
Time = 'date + % m "-" % d "" % k ":" % m'
Day = 'date + % m "-" % d'
Rx_before = 'ifconfig eth0 | sed-n "8" p | awk '{print $2}' | cut-c7
An example of how to obtain the timestamp using mktime in php
$ Now = mktime (0, 0, 0, date ("m"), date ("d"), date ("Y "));
Echo "now is". date ("Y/m/d", $ now );
Display result: now is this is obviously
echo Time (); Return "1264668961"
?>
Copy Code2,date ()The date () function is required to convert the UNIX timestamp to the current time that can be read.The prototype of the date function is as follows:
PHP simulates two date processing functions of SQLServer. It is very inconvenient to process dates in PHP, for example, to find the month of the difference between two dates? What should I do? File name: before using these two functions, date. inc.
PHP simulates the two date processing functions of SQLServer and reads the two date processing functions of PHP to simulate SQLServer. // It is very inconvenient to process the date in PHP, such as finding the month of the difference between the two
The time () function returns the current time. The main function of the mktime () function is not to return the current time, but to format the time () function to return the current time. The main function of the mktime () function is not to return
PHP simulates two date processing functions of SQLServer. It is very inconvenient to process dates in PHP, for example, to find the month of the difference between two dates? What should I do? File name: before using these two functions, date. inc.
As I mentioned at the beginning of the article, the reason for writing this article is that I cannot find a DateDiff function similar to ASP in php. After introducing how PHP processes the date and time, let's port two common functions in ASP to PHP.
Frequently-used host monitoring Shell scripts recently, a friend asked me about server monitoring. besides open source software, for example, cacti, can I write shell scripts on my own outside nagios monitoring? Shell scripts written according to
In fact, to be accurate to the week, that is, given the current time, know is the term of the first few weeks of school. The crux of the problem seems to be the lack of regularity, I am using the following code (PHP), the accuracy is not good enough:
The time () function returns the current date. The main function of the mktime () function is not to return the current time, but rather to format the time. Although writing mktime () alone does not add any parameters such as Echo mktime () and Echo
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
Mktime (hour, minute, second, month, day, year, is_dst) is the syntax of mktime. It is not difficult to write a timestamp code at a glance!
The following code is a timestamp provided by most people on the Internet. At first glance, it can only be
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.