PHP obtains the date range of the current week (month. PHP needs to get the date range of the current week (month), and write a date range to get the current week, that is, from Monday to Sunday. FunctiongetWeekRang PHP gets the date range of the
PHP date formatting, date calculation, and obtaining the start and end dates of the current week and month. PHP date formatting and date calculation as well as getting the current week, month header and end date PHP date format and date calculation
[Code Note] Get the date of the current week, the date of the Code note
I. Code.
-(Void) viewDidLoad {[super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. NSLog (@ "current week: % @", [self
PHP Gets the date range for the current week (month)
The program needs to write a date range that gets the current week, which is the date range from Monday to Sunday.
function Getweekrange ($date) {
$ret =array ();
$timestamp =strtotime
PHP date formatting and date calculation as well as getting the current week, month and tail date
PHP date formatting and date calculation as well as when getting previous week, month tail date
PHP date formatting Sample code:
/** * Format time
MySQL obtains the start_dateend_date bitsCN.com of the current week, month, and quarter.
MySQL obtains start_date/end_date of the current week, month, and quarter.
The first day of the current week:
Select date_sub (curdate (), interval weekday
PHP date formatting and date calculation as well as when getting previous week, month tail datePHP date formatting Sample code: /** * Format time * $type: Type * $strDate: Time string to process * * Year y: four-digit year y: two-bit year * Month
PHP date formatting, date calculation, and obtaining the current week and month start and end datesPHP date formatting and date calculation, and when obtaining the previous week, month and end date
PHP date formatting sample code:
/*** Format time **
Obtain the time from Monday to Sunday of the current week. obtain the time from Monday to Sunday of the current week.
$ Date = new DateTime (); // Time object $ date-> modify ('This Week'); // specify the week, echo $ date-> format ('Y-m-D') on
PHP obtains the date range of the current week (month)
The program needs to write a date range for obtaining the current week, that is, the date range from Monday to Sunday.
Function getWeekRange ($ date ){
$ Ret = array ();
$ Timestamp = strtotime (
Obtain the year, month, and day of the current week from the year, month, and day of the current week from the year, month, and day of the current day.
PHP code
// Obtain the end date of the latest week corresponding to the year, month, and Day.
PHP date formatting and date calculation and when getting before week, month and end date
PHP date format Sample code:
/** * Format time * $type: Type * $strDate: Time string to be processed * * Year y: four-bit year y: two-bit year * month M:
Learn from:http://my.oschina.net/hermer/blog/151274 /*** Test *@paramargs*/ Public Static voidMain (string[] args) {//define the output date formatSimpleDateFormat SDF =NewSimpleDateFormat ("Yyyy-mm-dd EEE"); Date currentdate=NewDate ();
This article copy from: http://swxzqsd.blog.sohu.com/156208509.htmlCamelcanoeString today = "2010-01-11";SimpleDateFormat format = new SimpleDateFormat ("Yyyy-mm-dd");Date date = Format.parse (today);Calendar calendar = Calendar.getinstance
PHP obtains the year, month, and day of the current week based on the year, month, and day of the current day.
// Obtain the end date of the latest week corresponding to the year, month, and day.
Function GetClearWeek (){
Thought: Based on the DayOfWeek attribute of the DateTime class, we get the English name of the week, and then get the Monday by adding and subtraction of date days.1. Call:String today = "2015-7-13";//system.datetime.now.tostring ();Lblday.text =
Current week
W = weekday (date)Lastday = dateadd ("D", 7-w, date)Firstday = dateadd ("D", 1-w, date)
Or
Select IDS from news_external where datediff (wk, entry_date, getdate () = 0
Current month
Select IDS from news_external where datediff (M,
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.