#-*-coding:utf-8-*-" "Gets the date of n days or n months before and after the current date" " fromTimeImportstrftime, LocalTime fromDatetimeImportTimedelta, DateImportCalendarYear= Strftime ("%Y", LocalTime ()) Mon= Strftime ("%m", LocalTime ()) Day= Strftime ("%d", LocalTime ()) hour= Strftime ("%H", LocalTime ()) min= Strftime ("%M", LocalTime ()) SEC= Strftime ("%s", LocalTime ())deftoday ():" "" get today,date format=" Yyyy-mm-dd "" '" returnD
2012 is April 5Qingming Festival is based on two of the four solar terms to calculate. So it is not necessarily the annual Ching Ming Festival is April 4. Qingming is one of the Shiber, Qingming Festival in the Qingming that day, the annual qingming roughly all in the Gregorian calendar April 4 to April 6 day. The Division of solar terms is based on the sun and the equator, so the lunar calendar does not have a certain day.2010 of the Qingming Festival is April 52010 Ching Ming Festival holiday:
Ask to calculate how many days the date is from October 1, 1949
For example:
User entered: 1949-10-2
Program output: 1
User entered: 1949-11-1
Program output: 31
In total, two classes were written, and then the code was slightly scrambled:
Yearandmonth:
Require ("Yearprint")Local nyear = 1949Local Nmonth = 10Local Nday =1--[[----@param #number year passed the argument is the number of years--@param #number month passed the parameter is the month--@par
See today a reprint as follows:Linux Kernel 2.6.28 or more defective and re-initiated on the first 208.5 dayshttps://access.redhat.com/knowledge/solutions/68466Sched_clock () overflow around 208.5 days in Linux kernellast modified by Raghu Udiyar on 04/10/12-09:12issue
Linux Kernel panics when Sched_clock () overflows around 208.5 days
Does RHEL 6.1 have a reboot problem which are caused by sch
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;$
ORACLE any time period all days query, no need to use what all_objects No * query to all days * selectdate2013-11-25 + (rownum
ORACLE queries all the days in any time period, no need to use any all_objects no/* query all the date days from to */select date '2017-11-25 '+ (rownum-1) dt from dual connect by rownum = (dat
PHP format the time several days ago, several minutes ago, etc.
Class DateFormat
{
Private static $ _ DIFF_FORMAT = array (
'Day' => '% s days ago ',
'Day _ hour' => '% s DAY % s HOUR before ',
'Hour '=>' % s HOUR ',
'Hour _ MINUTE '=>' % s HOUR % s before ',
'Minute '=>' % s Minutes Ago ',
'Minute _ second' => '% s minutes % s before
Obtains the last day of a month or the number of days of a month.
// Obtain the last day of a month or the number of days of a month
Function getMonthLastDay ($ month, $ year)
{
Switch ($ month)
{
Case 4:
Case 6:
Case 9:
Case 11:
$ Days = 30;
Break;
Case 2:
If ($ year % 4 = 0)
{
Because there are too many servers, the previous daily backup log files will accumulate over time.Very large.And there is no need to keep that much, according to the company's requirements only need to keep a week.1. Is there any way to automatically delete the *. log File backed up seven days ago?2. There are too many servers, and it is impossible to manually create one by one. Is there any batch processing that automatically completes this creation
The pick-up time can only be two days after the order is made. How can I write it in php? Currently, the problem is that not every month is 31 days. If the goods are set on the 30th, You need to select the next month's time. Should this be added? Thank you for choosing only two days after the order. How can I use php?
Currently, the problem is that not every mon
['name']; // here I set the file name to date plus the file name to avoid duplication.$ R = move_uploaded_file ($ f ['tmp _ name'], $ dest );Chmod ($ dest, 0755); // sets the attributes of the uploaded fileThe uploaded file name is date ("ymd "). "_". $ f ['name'] can be used later when it is inserted into the database. PHP actually moves the files you uploaded from the temporary directory to the specified directory. Move_uploaded_file ($ f ['tmp _ name'], $ dest );Mail is simpler. You can use
A few days ago issued a post, is about Display within five days of this date comparison, http://www.oso.com.cn/forum/read.php? Theme_id7459 focuses on SELECTsomethingFROMtableWHERETO_DAYS (NOW ()-TO_DAYS (date_col) lt; 5 ;.
I posted a post a few days ago about displaying the date comparison within five days,Http://ww
PHP converts a date string to the current number of days as an example and input a date string. for example, 2011-3-23 outputs the current number of days as an example. for example: 1? Code :? PublicstaticfunctionconvertDateToLong ($ dateStr) {$ checkPattern ^ d {4} (-d {1, 2}) {2}) | ((. PHP converts a date string to an example of the current number of days
En
The effect is as follows:The code is as follows. It must be noted that: 1. A year is defined as 360 days, and a month is 30 days. 2. In the code, 86400 = 24*60*60, represents the total number of seconds in a day. 3. Both of these time periods must be written in a format similar to. 4. All PHP programs should be promoted, you can change the parameter Get_option ('swt _ builddate') for wordpress to th
Due to the large number of servers in the company, the daily backup log files created previously accumulate over time.Very large.
And there is no need to keep that much, according to the company's requirements only need to keep a week.
1. Is there any way to automatically delete the *. log File backed up seven days ago?
2. There are too many servers, and it is impossible to manually create one by one. Is there any batch processing that automatically c
Label: Style Color ar strong SP on problem EF time
Today is Sunday, January 1, October 24. I thought that I would take the next Monday test ("Principles of Automatic Control"). So I have been preparing for the test in an orderly manner over the past few days, and I have not paid much attention to it study. But today, I suddenly saw that the school's educational administration network changed the examination time again-a delay of three
The script reads as follows:#!/bin/Bashfunctiondelete_file{dir=$1 Days=$[$2-1] forIinch`Find$dir-type F-ctime +$days ' Do RM-RF $i Done} whileRead Line Dodir=`Echo$line |awk '{print $}'' days=`Echo$line |awk '{print $}'' Delete_file $dir$days Donefile. txtWhere the function delete_file is used to delete the Dir direct
You may think this summer is particularly hot, in fact, every summer is very hot, when it comes to the hottest of course is volts days, then the annual volts is from what time? Every year, volts is the beginning of the same day? Let's study it together.
What day is volts?
The Gregorian calendar June 21, 2014 is the summer solstice, but Volts does not begin on the summer solstice, but begins on July 18, 2014 volts , dog date from the summer solstic
Objective
What exactly is a Calendar? Chinese translation is the calendar, then we can immediately think of our lives in the Yang (public) calendar, Yin (Nong) calendar points. What is the difference between them?
For example, there are:
Definition of month-yang ' (gong) calendar 12 months a year, the number of days each month is different; Yin (Nong) calendar, fixed 28 days per month
The first day of t
The example in this article describes how PHP obtains the maximum number of days (last day) of a month. Share to everyone for your reference. Specifically as follows:
Gets the maximum number of days (last day) of a month
function Getmonthlastday ($month, $year) {
switch ($month) {case
4: Case
6:
Case 9:
$days =;
break;
Case 2:
if ($year% 4
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.