Simulate two SQL server functions: dateadd () and datediff (). read the two functions that simulate SQL Server: dateadd (), datediff (),? Php // File name: date. inc. php3 // before using these two functions, convert the date or date to the
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,
Print $ week_start & nbsp; date (U, mktime (0, 0, 0, date (m), date (d)-7, date (Y); $ week_end & nbsp; date (U, mktime (23, 59, 59, date (m), date (d)-0, date (Y); $ dateda prints every day of the previous week
$week_start =
// 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
// It is inconvenient to process dates in PHP, for example, to find the month with a different date? What should I do?
// File name: Date. Inc. php3
// Before using these two functions, convert the date or date to the timestamp type.
// For example:
In php, we want to add or subtract time and date. We can use two functions: mktime and strtotime. Next I will introduce you to their usage.
Mktime Function
The mktime () function returns the Unix timestamp of a date.
The parameter always represents
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
Obtaining the date and time is also frequently used in website design. Php provides the date () time function to implement this function. The structure is as follows:Instance: The code is as follows:Copy code Echo date ("F j, Y, g: I a"). "&
Get the start and end of the time stamp of the week (This day)Time stamp of the week Monday$monday = mktime (0, 0, 0, date ("M", Strtotime ("last Monday")), date ("D", Strtotime ("Last Monday"), Date ("Y", Strtotime ("l AST Monday ")));Time stamp of
a few common Linux monitoring scriptsA few common Linux monitoring scriptsThe following is a number of host monitoring scripts, we can change according to their own circumstances, and hope to give you a little help.1. Check the host network card
The Linux command is invalid-bash:ls:command not foundAfter a reboot, all basic commands are unavailable and only a few commands are available[email protected] ~]# LL-bash:ls:command not found[Email protected] ~]# pwd/root[Email protected] ~]#
To provide you with five of commonly used Linux monitoring scripts (see Host network card traffic, system monitoring, monitoring the disk space of the host, when the use of more than 90% of the space through the mail to send a warning, monitoring
This paper introduces several common Linux monitoring scripts, which can realize the automatic monitoring and alarming of host network card traffic, system condition, host disk space, CPU and memory usage. According to their own needs to write a
Processing dates in PHP is very inconvenient, such as asking for a difference between the two dates of the month? What should we do?
FileName: date.inc.php3
Before you use these two functions, you must first convert the date or datetime to the
1) Date
Usage:
Date (format, [time]);
If there is no time argument, the current time is used.
A format is a string in which the following characters have special meaning:
U replaces the number of seconds since a start time (as if it were January 1, 1
FileName: date.inc.php3
Before you use these two functions, you must first convert the date or datetime to the timestamp type.
Such as:
$today =mktime (0,0,0,date ("M"), Date ("D"), Date ("Y"));
/**** simulate the DATEADD function in SQL Server ****
Control
?Date Special Operation Control classYufan August 15?>?Gets the current time for the "YYYY-MM-DD" formatfunction Nowdate (){$result = Date ("Y"). " -". Date (" M ")." -". Date (" D ");return $result;}
Gets the current time for the
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.