PHP prints out the date you want:Case: Below is the date printed out with the beginning of January 01, 2017, 360 for the period of Monday, Wednesday, and SaturdayHeader (' Content-type:text/html;charset=utf-8 ');Date_default_timezone_set (' PRC
Python3 the time moduleTime & datetime & CalendarI. OverviewPython provides many ways to handle dates and times, and converting date formats is a common feature.Time tuples : Many Python functions use a single element to assemble 9 sets of digital
The date () function makes it easy to get the data above
The code is as follows
Copy Code
$month = $_get[' m ']?$_get[' m ']:d ate (' n ');$year = $_get[' y ']?$_get[' y ']:d ate (' Y '); $start _week = Date (' W ',
PHP can display the date and time of the server through the date () function, and here's a detailed look at how to use the date () function to output the date:
php Date () function detailed
1, year-month-day
The code is as follows
1. What is a shell script?It is a scripting language, not a programming language.You can use some logical judgments, loops, and other syntax.You can customize the sub-function, which is a collection of system commands.Shell scripts enable automated
PHP Date-time function date ()1, year-month-day
Copy Code code as follows:
echo Date (' y-m-j ');
2007-02-6
echo Date (' y-n-j ');
07-2-6
Capital Y represents a four-digit year, while lowercase y represents a
PHP Date-time function date ()
1, year-month-day
echo Date (' y-m-j ');
2007-02-6
echo Date (' y-n-j ');
07-2-6
Capital Y represents a four-digit year, while lowercase y represents a two-digit number for the year;
Lowercase m represents the number
Example
$t = time ();
Start time stamp
$start = Mktime (0,0,0,date ("M", $t), date ("D", $t), date ("Y", $t));
End time stamp
$end = Mktime (23,59,59,date ("M", $t), date ("D", $t), date ("Y", $t));The definition and specific usage of the
A more good PHP calendar code
Copy Code code as follows:
/**
* Calendar
*
* Copyright (c) 2007 by Chen Yixin (Deep Space). All rights reserved
* To contacts the author write to {@link mailto:shenkong@php.net}
* @author Chen Yixin
On the front page of the page, add
Date_default_timezone_set (PRC); /* To transfer time to Beijing time, PHP5 defaults to Greenwich Standard TIME * *
Date ()
A: "AM" or "PM"
A: "AM" or "PM"
D: A few days, two digits, if not enough to fill 0; from "01
Copy Code code as follows:
PHP gets today start timestamp and end time stamp
$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
Guide:Capital Y represents a four-digit year, while lowercase y represents a two-digit number for the year;Lowercase m represents the number of months (with leading), while lowercase n indicates the number of months without leading.echo Date ('
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 job requires me to find two time and date control, this does not use JS as long as PHP
The project needs to do a weekly reporting function, you need to know the start date and end date of the specified number of weeks in order to handle other business. Here's a section of code that uses PHP to get the start and end dates of each week
The Provides a date that gets the calendar list for the week of this date, and the key is the week mark
$month _date = ' 2015-09-25 ';
$start _time = strtotime ($month _date);
$start _week = Date (' W ', $start _time);
$total _month_day =
The first and last day of the week
Copy Code code as follows:
$date =new DateTime ();
$date->modify (' this week ');
$first _day_of_week= $date->format (' y-m-d ');
$date->modify (' This week for +6 days ');
$end _day_of_week=
PHP Week to get code:Date ("L"); Data will be available for English week like SundayDate ("W"); This can get a digital week like 123, note 0 is Sunday
Get Chinese day of the week:$weekarray =array ("Day", "one", "two", "three", "four", "five", "six")
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
1, year-month-dayecho Date (' y-m-j ');
2007-02-6
echo Date (' y-n-j ');
07-2-6
Capital Y represents a four-digit year, while lowercase y represents a two-digit number for the year;
Lowercase m represents the number of months (with leading), while
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.