The month before the next day of the day before the javaScript day, the month before// Monthly subscription on the date of the previous month// Previous monthFunction LEFT_CALENDAR (){Var output = new Date (disp. get ("CALENDAR"). replace (/-/g ,"/")
This article is reproduced from: http://www.blogjava.net/gf7/archive/2012/07/01/381933.html
function trunc is an Oracle-built function that can be "tailored" to date type data to accommodate different types of data requirements.
In the previous
Of course, PHP's date function is not possible to directly output Chinese date, but you can use this method to write a function of their own.Code to copy code as followsfunction today () {Date_default_timezone_set ("asia/chongqing");$a =date
PHP uses Strtotime to get last month, next month, month's date, Strtotime last month
Write the program today, suddenly found a long time to write a long time to get the number of days of the function, the classic switch version, but to get the
The month before the next day of the javaScript day// Monthly subscription on the date of the previous month// Previous monthFunction LEFT_CALENDAR (){Var output = new Date (disp. get ("CALENDAR"). replace (/-/g ,"/"));Output. setTime (output.
Start with the new Date () test and get through Date.getmonth (), and Date.getday (), but later found that the two jdk1.1 versions of the visit are now unused and the results are incorrect.int month = (date. Get(calendar.month)) +1; int day = date.
The first day of the month on which the given date is calculated
The trick is to calculate the
number of time intervals between the current date and "1900-01-01" and then add it to "1900-01-01" to get a special date, a technique that can be
Select GETDATE () as ' current date ',Datename (Year,getdate ()) as ' year ',Datename (Month,getdate ()) as ' month ',Datename (Day,getdate ()) as ' Day ',Datename (Dw,getdate ()) as ' Week ',Datename (Week,getdate ()) as ' Week number ',Datename
//////by the number of seconds to get the date a few days a few hours ... //////Number of seconds///0: Converted with seconds, 1: No seconds after conversion///a few days, hours, minutes, seconds . Public Static stringParsetimeseconds (intTinttype) {
PHP calculates the difference between two time periods (in seconds, hour, day, month, and year)
Sample Code of the month difference between two time periods:
The Code is as follows:
$ Yourdate = "2012-10-20 ";$
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.