//////by the number of seconds to get the date a few days a few hours ... //////Number of seconds///0: Converted with seconds, 1: No seconds after conversion///a few days, hours, minutes, seconds . Public Static stringParsetimeseconds (intTinttype) {stringR ="";intDay , hour, minute, second;if(T >=86400)//days,{ Day= Convert.ToInt16 (t/86400); hour= Convert.ToInt16 ((t%86400) /3600); minute= Convert.ToInt16 ((t%86400%
would perform housekeeping procedure (in hours).# housekeeping is removing unnecessary information from the history, alert, and alarms tables.## Mandatory:no# range:1-24# Default:#说明: How many hours to clean up the history of the agent-side database, alert, and alarms to keep the proxy-side database lightweight, it is recommended to keep the default# Housekeepingfrequency=1# # Option:maxhousekeeperdelete# The table "housekeeper" contains "tasks" for housekeeping procedure in the format:# [House
';$end=strtotime('2018-8-16 00:00:00');$d=$end-$now;$y=floor($d/3600/24/30/12);$m=($d/3600/24/30)%12;$dt=($d/3600/24)%30;echo "距世界杯还有{$y}年{$m}个月{$dt}天";
How can you write if you have an error in writing this month?Does this error have an effect?
Reply content:
';$end=strtotime('2018-8-16 00:00:00');$d=$end-$now;$y=floor($d/
The blog calendar implementation code in php shares a blog calendar implementation code in php. it is very easy to query the database, as long as you modify the field name to be the same as that in your database, the instance code is as follows:
Function calendarnew ($ starttime = 0 ){
Global $ db, $ tablepre, $ timestamp, $ site_timeoffset, $ site_dateformat, $ curtime;
$ Starttime = $ starttime? $ Starttime: $ timestamp;
$ Curtime = gmdate ($ site_dateformat, $ starttime + $ timeoffset *
The following is the implementation code. if you forget where the code was obtained, it may be Discuz! The personal space is now posted to share with you the following implementation code. if you forget where to find the code, it is probably Discuz! In the personal space
Now post it for everyone to share
Function calendarnew ($ starttime = 0 ){
Global $ db, $ tablepre, $ timestamp, $ site_timeoffset, $ site_dateformat, $ curtime;
$ Starttime = $ starttime? $ Starttime: $ timestamp;
$ Curti
Cookie is used to store information in the client browser. We can use cookies to record user-related information. For example, the webmaster's statistical code is implemented based on cookies and ip addresses, the following describes how to use and pay attention to cookies.
PHP cookie usage
The Code is as follows:
Copy code
Setcookie ('mycooker', 'value ');// Function prototype: int setcookie (string name, string value, int expire, string path, string domain, int secure)E
different months$ Mm = $ math; // The total number of different months$ D = (mktime (0, 0, 0, $ m2, $ d2, $ y2)-mktime (0, 0, 0, $ m2, $ d1, $ y2 )) /86400;If ($ d $ M-= 1;$ D + = date ('J', mktime (0, 0, 0, $ m2, 0, $ y2 ));}$ M Return array ($ y, $ m, $ d, $ mm );}Calculated by day, hour, and second
$ One = strtotime ('2017-12-08 07:02:40 '); // start time stamp$ Tow = strtotime ('2017-12-25 00:00:00 '); // End Time Stamp$ Cle = $ tow-$ one; // get the timestamp difference/* This is just a pr
Instance code for month difference between two times:
The code is as follows
Copy Code
$yourdate = "2012-10-20";$yourdate _unix=strtotime ($yourdate);Echo (Date ("Y", $yourdate _unix)-date ("Y")) *12+ (date ("M", $yourdate _unix)-date ("M"));
Example 1
The code is as follows
Copy Code
/** Calculates month difference for 2 time periods* @param $st start time $et end time (timestamp format)* @return The difference $total return*/f
Instance code for month difference between two times:
The code is as follows
$yourdate = "2012-10-20";$yourdate _unix=strtotime ($yourdate);Echo (Date ("Y", $yourdate _unix)-date ("Y")) *12+ (date ("M", $yourdate _unix)-date ("M"));
Example 1
The code is as follows
/** Calculates month difference for 2 time periods* @param $st start time $et end time (timestamp format)* @return The difference $total return*/function Getmonthnu
We sometimes encounter more specific needs when doing a site, a message is a few days and days or one months ago, the last time you do an app ran into this week, leaving the code used at that time do not need to run around.
PHP Code:
function Calctime ($time){$now = time (); Current time$add = Strtotime ($time); Convert time to time stamp$str = ";$timeSpan = $now – $add;$days = Floor ($timeSpan/(24 * 3600 * 1000)); Calculate the difference between d
Tags: combining color ble ber SQL implementation DESC Query UnionHere we share the usage of federated queries.MySQL uses Union and Union All to implement a federated query of the data.Suppose you have the following two tables: mysql> SELECT * from the staff; +----+----------+-------+| ID | name | Slary |+----+----------+-------+| 1 | guoding | 3200 | | 2 | Dingtao | 2800 | | 3 | Haofugui | 3500 | | 4 | guoming | 4000 | | 5 | Haotian | 2900 | | 6 | Fengfei | 3200 | | 7 | guoting |
Create a Cookie array based on PHP. Create: Copy the code as follows: setcookie (ICNet [Reg], thisregcookie, time () + 3600); setcookie (ICNet [Active], Thisislogincookie ., time () + 3600); print_r ($ _ COOKI
Create:
The code is as follows:
Setcookie ("ICNet [Reg]", "This is reg cookie", time () + 3600 );Setcookie ("ICNet [Active]", "This is login cookie.", tim
difference /* This is just a promptEcho ceil ($ cle/60); // The total number of minutesEcho ceil ($ cle/3600); // calculates the total number of hoursEcho ceil ($ cle/3600/24); // returns the total number of days*//* Ceil () function, which is an integer in the next Method */$ D = cell ($ cle/3600/24 );$ H = cell ($ cle % (3
difference.Return $ total;}
Example 2
The code is as follows:
$ One = strtotime ('2017-05-08 07:02:40 '); // start time stamp$ Tow = strtotime ('2017-12-25 00:00:00 '); // end time stamp$ Cle = $ tow-$ one; // Get the timestamp difference /* This is just a promptEcho ceil ($ cle/60); // The total number of minutesEcho ceil ($ cle/3600); // calculates the total number of hoursEcho ceil ($ cle/
Add the php code for the calendar in the blog. Do you want to add a calendar to your blog by adding the php code for adding a calendar? Blue1000 is here to share with you a simple PHP blog calendar implementation code. if you need it, refer to the php code for adding a calendar in a blog.
Do you want to add a calendar in your blog? Blue1000 is here to share with you a simple PHP blog calendar implementation code. if you need it, please refer to it. it is very easy to query the database, you jus
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.