= mktime (0, 0, 0, $month + 1, 1, $year);
$t = $t-60 * 60 * 24;
return $t;
}
/**
* Get the week array of the system month, the first week insufficient need to complement
*/
function Getmonthweekarr ($current _year, $current _month) {
The first day of the month
$firstday = Strtotime ($current _year. '-'. $current _month. '-01 ');
A few days in the first week of the month
$firstweekday = (7-date (' N ', $firstday) + 1);
Calculate the tim
Phpcms v9 template making common code collection
1. Intercept Call title length
{Str_cut ($r [title],36, ')}, followed by quotation marks to remove ....
2. Format time
Call format Time 2011-05-06 11:22:33
{Date (' y-m-d h:i:s ', $r [Inputtime])}
3. Multi-column Call Multi-Recommendation bit call
Call Requirements: The article range is 59 60 613 columns, and pushed to 27 and 282 recommended bits;Starting with the third article, 7 consecutive articles are called.
{pc:get sql= "select * from V
= '\/Date (1419492640000) \/'; // C # Json format of DateTime type conversionVar msecStr = dateTimeJsonStr. toString (). replace (// Date \ ([-]? \ D +) \ // gi, "$1"); // => '000000': obtain the millisecond string through regular expression replacement.Var msesInt = Number. parseInt (msecStr); // converts a millisecond string to a value.Var dt = new Date (msesInt); // initialize the Date objectConsole. log (dt. toLocaleString (); // => December 25, 2014 3:30:40
6.2 get countdownNote: calculat
some PHP files.
2 User Cache Entries: indicates the Cache of User data. In encoding, User data can be cached to apc. To view the user data cache, you must first modify the access account and password. Open the apc. php file and find the following two lines of code to modify it:
The Code is as follows:
Ults ('admin _ username', 'apc '); // ADMIN USERNAMEUlts ('admin _ password', 'Password'); // admin password-change this to enable !!!
3. apc example
Apc is easy to use. See the following examp
"; allow-transfer{192.168.1.11;}; notifyyes;also-notify{192.168.1.11;};}; zone "168.192.in-addr.arpa" {# here is the added reverse resolution domain name, which represents resolving 192.168 segments of the host typemaster; file "168.192.zone";#zone file name allow-transfer{ 192.168.1.11;}; notifyyes;also-notify{ 192.168.1.11;}; };}; After you have added a domain with PTR, you need to specify the resolved content in the specified 168.192.zone file: [[emailprotected]etc]#cat168.192.zone $TTL
display time is "Greenwich Mean Time", which is 8 hours different from our local time ---------The time zone must be correct.
The NOW () function returns the current date and time with ''yyyy-MM-DD HH: MM: s'' and can be saved directly to the DATETIME field.
CURDATE () returns today's DATE in 'yyyy-MM-DD 'format and can be saved directly to the DATE field.
CURTIME () returns the current TIME in 'hh: MM: ss' format and can be saved directly to the TIME field.
Mysql statementinsert into xxxx
1. Calculate the data issue between the current time and the same time period of yesterday
This problem requires you to know the current time and the time after the current time minus 24
Method 1: Use time () and date ()
For example:
$ Time = time ();
$ Tomorrow = time () + 24*3600; // Same time tomorrow
Echo '4: '. date ('y: m: d H: I: s', $ tomorrow );
$ Yestoday = time () + 24*3600; // same time as yeste
'/}
Call thumbnail:
The published article displays a red date or a new or new small image.Display a red date or add a new word or a new small image to an article published in the last three days (or the same day.They all write extensions around pubdate.2nd and 3 note the following: " cannot use double quotation marks; otherwise, it cannot.If you want to add 3600*24*3 for the day, change it to 3600
the two. var intervalSec = intervalMsec/1000; // convert to the number of seconds var day = parseInt (intervalSec/3600/24); // Number of days var hour = parseInt (intervalSec-day * 24*3600)/3600 ); // hour var min = parseInt (intervalSec-day * 24*3600-hour * 3600) /60); //
Public class timestringformat {/***** @ title: stringtotime1 * @ description: string in the specified format is converted to seconds * @ return long return type * @ throws */public static long stringtotime1 (string Str) {string [] strarr = Str. split (":"); int result = 0; int I = 3600; For (string ST: strarr) {result + = integer. parseint (ST) * I; I = I/60;} return long. parselong (result + "");}/***** @ title: stringtotime2 * @ Description: convert
In C #, two timespans are subtracted to get a timespan instance. timespan has some attributes: days, totaldays, hours, totalhours, minutes, totalminutes, seconds, totalseconds, and ticks. Do not use totalticks.
These attribute names are difficult to understand, but after reading this article, you must start to understand them.
Example
The time 1 is 8:43:35;
The time is 8:43:34.
Use Time 2 minus time 1 to get a timespan instance.
Then the time 2 is 9 days, 23 hours, 59 minutes, and 59 seconds
Convert two date strings into unix timestamps and subtract them to get the timestamp difference. Finally, determine the remaining time and generate a time format similar to (2 hours, 30 minutes, 20 seconds ago) The code is as follows:Copy code Public function gettime ($ time_s, $ time_n ){$ Time_s = strtotime ($ time_s );$ Time_n = strtotime ($ time_n );$ Strtime = '';$ Time = $ time_n-$ time_s;If ($ time> = 86400 ){Return $ strtime = date ('Y-m-d H: I: S', $ time_s );} If ($
Phpcms v9 template making common code collection (personal collection)1. Intercept Call title length{Str_cut ($r [title],36, ')}2. Format timeCall format Time 2011-05-06 11:22:33{Date (' y-m-d h:i:s ', $r [Inputtime])}3. Multi-column Call Multi-Recommendation bit callCall Requirements: The article range is 59 60 613 columns, and pushed to 27 and 282 recommended bits;Starting with the third article, 7 consecutive articles are called.{pc:get sql= "select * from V9_news where ID in (SELECT ID from
file:/etc/csf/csf.denyOnce the changes are complete, use this command to restart the CSF:SUDO/ETC/INIT.D/CSF restartThe following is part of the Csf.deny file on a server to illustrate the usefulness of CSF:211.216.48.205 # Lfd: (sshd) Failed SSH login from 211.216.48.205 (Kr/korea, Republic of/-): 5 in the last 3600 Secs-fri Mar 6 00:30:35 2015103.41.124.53 # Lfd: (sshd) Failed SSH login from 103.41.124.53 (Hk/hong kong/-): 5 in the last
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.