First, Shell script introductionShell scripts to write well, you must continue to practice writing to write well, there is no shortcutTo have a general idea of a script when we get a demand, think of how the need to achieveShell scripting can
Composition + Execution
Need to add #! at the beginning /bin/bash
Lines that begin with # are interpreted as explanatory notes
The name of the script ends with. SH and is used to differentiate between this is a shell script
[[Email protected] shell]# date +%y year, 4-digit2018[[Email protected] shell]# date +%y year, 2-digit18[[Email protected] shell]# date +%m Month04[[Email protected] shell]# date +%m M, number of minutes57[[Email protected] shell]# date +%d13[Email
This article mainly introduces the common time processing methods for PHPdate functions. This article describes how to obtain the time of today, tomorrow, yesterday, one week, one month ago, one month, and so on, for more information, see
The Code
Here are some of the time functions in PHP:(1) DateUsage: Date (format, [time]);If there is no time parameter, the current time is used. The format is a string, where the following characters have special meanings:U is replaced by the number of
O-w Week converted to the last day of the normal date week public function Weektodate ($oW) { $oW = explode ("-", $oW); Split o-w Zhou Weihin and weeks $year = $oW [0];//year $week = $oW [1];//week number
My data table is as follows: My goal is to retrieve the answers of comments, answers, and members in the broker_achieve table in the previous week, calculate the value based on the comments number weight 50%, answers number weight 25%, and members
A relatively good php calendar codeCopy codeThe Code is as follows:/*** Calendar** Copyright (c) 2007 by Chen Yixin (Deep Space). All rights reserved* To contact the author write to {@ link mailto: shenkong@php.net}* @ Author Chen Yixin (deep space)*
PHP gets today's start timestamp and end timestamp$beginToday=mktime(0,0,0,date(' m '),date (' d '),date(' Y ')); $endToday=mktime(0,0,0,date(' m '),date(' d ') +1,date(' Y '))-1;PHP gets yesterday start timestamp and end
PHP gets the start timestamp and end timestamp of today, yesterday, last week, this month, mainly using PHP's time function mktime. Let's start with a straight-through example to illustrate how to use Mktime to get the start timestamp and end
The date () function is one of the dates that we often encounter and use in PHP development, let me introduce some basic dress and method of date () function, and have a friend who needs to know to enter into the referenceDate-time functions are a
AddDate_default_timezone_set (PRC);/* set the time to Beijing Time, and PhP5 is the Greenwich Mean Time by default */Date () A: "am" or "PM"A: "am" or "PM"D: day (s), double-digit number. If it is not enough, it will be zero. From "01" to "31"D: The
In PHP, sort the parameters related to the date () date function. For more information, see.
In PHP, sort the parameters related to the date () date function. For more information, see.
Add
Date_default_timezone_set (PRC);/* set the time to
Php specifies the date to obtain the format of the day of the week, such as 20151225. How can I find the day of the week... Ask for advice.
Reply to discussion (solution)
$ Time = time ();Echo date ('D', $ time); // The Day of the
The GROUPBY algorithm of PHP simulated SQL BY JENNER · February 25
Github address: https://github.com/huyanping/Zebra-PHP-ArrayGroupBy
Packagist address: https://packagist.org/packages/jenner/array_group_byWhy use Zebra-PHP-ArrayGroupBy
Php Basics + jquery Basics 1. compile a function so that it can return the number of weeks between them based on the passed 2-year week number (including the two weeks passed in)
2. use JQuery to dynamically add the amount input box for each day
Two PHP date control class instances, PHP date class instances
The examples in this article describe two PHP date control classes. Share to everyone for your reference. The specific analysis is as follows:
Because the work needs me to find two time
The first and last day of the week
Copy CodeThe code is as follows:
$date =new DateTime ();
$date->modify (' this week ');
$first _day_of_week= $date->format (' y-m-d ');
$date->modify (' This week +6 days ');
$end _day_of_week= $date->format ('
Php obtains the start timestamp and end timestamp of today, yesterday, last week, and this month. php obtains the start timestamp and end timestamp of today, yesterday, last week, and this month, it mainly uses the php time function mktime. Next,
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.