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 M: two-digit month N: one digit month Part M: English month * Date D: T
Today, some of the online excerpts of the operation date of the relevant methods, and now share with you.
Copy Code code as follows:
The following methods are specifically extended:
parsechs--static method. Resolves the commonly used Chinese dates and returns the date objects.
add--date plus minus operation. [Note: There is a bug in this function
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: two digit month N: One digit month M: English month *
Java date: add one day, year, month, and date plus 1, date + 1, month + 1, year + 1, and date
System. out. println ("String type" + endDate); // The time when the page is passed to the background is String type SimpleDateFormat sdf = new SimpleDateFormat ("yyyy-MM-dd "); date
/* (Start of program header annotation)* Copyright and version Declaration of the program* Copyright (c) 2011, a student from the computer College of Yantai University* All rights reserved.* File name: enter a date, which is the day of the year.* Author: Lei hengxin* Completion date: January 1, September 09, 2012* Version No.: V1.0* Description of tasks and Solutions* Input description:* Problem description
Table structure is as follows
Number Date
8 2009/1/11 2:00
7 2009/1/11 5:00
6 2009/1/11 12:00
5 2009/1/11 18:00
4 2009/1/12 4:00
3 2009/1/12 10:00
2 2009/1/12 12:00
1 2009/1/11 17:00
The difference between the number of the earliest and the latest of the day is the result of the following:
Poor
2
3
Copy Code code as follows:
CREATE TABLE #date
(
Number int identity (1,1) primary key,
Contact Bootstrapvalidator time, recently need a number of field co-verification, the web looked up a bit not found, consult the API documentation, found that can be achieved.Look at Dom first.DivClass= "Form-group">LabelClass= "Col-sm-3 Control-label"> End of Life:Label>DivClass= "Col-sm-9 Row">DivClass= "Col-xs-5">DivClass= "Input-group">InputType= "Text"Name= "Beginyear"Class= "Form-control"/>SpanClass= "Input-group-addon"> YearSpan>Div>Div>DivClass= "Col-xs-1"Style= "LINE-HEIGHT:36PX;"> ToDi
Js Date function date formatting extension, js Date function date
Prototype is to add attributes and methods to an object and return references to the object type prototype. For example, to extend the Date function in js:
Date.
JS string to date format Date Format String, js Date Format
1/** 2 * @ author Chen weibin 3 * if you want to format the date string, you need to first convert it to the Date type Date 4 * below are several common 5*6 * var da = ne
Convert a string in the format of "yyyy-mm-dd" to Java. SQL. Date:
Simpledateformat bartdateformat = new simpledateformat ("yyyy-mm-dd "); String datestringtoparse = "2007-7-12 "; Try { Java. util. Date = bartdateformat. parse (datestringtoparse ); Java. SQL. Date sqldate = new java. SQL. date (
In the actual development process will often need to encapsulate the date type of data in XML or JSON format on the network for transmission, in addition, when the date type of data stored in the SQLite database and then fetched only the date of the string type, because SQLite is untyped. This has to do with the problem of converting a
PHP obtains the start date and end date of the week (month) of the current date. it obtains the start time and end time of the week of the specified date. functiongetWeekRange ($ date) {$ retarray (); $ timestampstrtotime ($ date)
To the specified date, Month day, get the start date of the week (example: 2016.6.15 get 2016.6.13-2016.6.19) public
function Get_oneweek ($one _date) {
//$first =1 indicates that the starting date of Monday per week is 0 for each Sunday as the start date
$first =1;
Gets the day ordinal of the current week Su
PHP obtains the start date and end date of the week (month) of the current date (implementation code ). The code is as follows: get the start time and end time of the week of the specified date functiongetWeekRange ($ date) {$ retarray (); $ timestampstrtoti is not much nons
The table structure is as follows:Number date8 2009/1/117 2009/1/116 2009/1/11 12: 005 2009/1/114 2009/1/12 4:003 2009/1/12 10: 002 2009/1/12 12:001 2009/1/11The result is as follows:Difference23Copy codeThe Code is as follows:Create table # date(Number int identity (1, 1) primary key,Date datetime)Insert into # date select '2014/1/11'Insert into #
This article provides a detailed analysis of PHP code for getting the start date and end date of the Week (month) of the current date. For more information, see
This article provides a detailed analysis of PHP code for getting the start date and end date of the Week (month)
Php code for retrieving the start date and end date of the week (month) of the current date
// Obtain the start time and end time of the week of the specified date.
// Organize the programmer's home
// At 2013-6-18
Function getWeekRange ($
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.