Objective
This function is often used in developing iOS, and the one-month interval is the first and last day, and you need to know how many days of the month to know what the last day is, and whether it is a leap year, maybe 28 days in February.
This is a function that calculates the number of days from January 01, 2000 to a specified day
(Calculate head also count tail) date format is: YYYY-MM-DD
Calculate the number of days from January 01, 2000 to one day
function Cal_start2end ($end
Using javascript to calculate the number of days between two dates ASP can calculate the gap between the two dates DateDiff, but there is no javascript in it and a handwritten function is required.
Js inside can be directly Date1-Date2, and still
Java Date, the day of the year, the abbreviation of the week, the number of days of the month, the number of months of the year, javadate
Import java. util. *; public class DateDemo {public static void main (String args []) {Date date = new Date ();
Obtains the last day of a month or the number of days of a month.
// Obtain the last day of a month or the number of days of a month
Function getMonthLastDay ($ month, $ year)
{
Switch ($ month)
{
Case 4:
Note: For example, between 1900-01-01 and 1900-01-01, one dayprivate static int DateDiff (DateTime datestart, datetime dateend) { datetime start = Convert.todatetime ( Datestart.toshortdatestring ()); DateTime end =
Java processing 2 time period of a few days is very easy, direct correlation method is OK, but JS processing this kind of problem a little bit difficult, project development also used, as follows:
123456789101112
Do a time countdown and find that the days are always incorrect.JS Code:1 //Define target Date2 varTargettime =NewDate ();3 4 //Target Date5Targettime.setfullyear (2015,5,1);6 7 //Target when8Targettime.sethours (12);9 Ten //Target points
This article gives a detailed analysis of how to use PHP to calculate the year, month, week, and number of days between two dates, for more information, see use PHP to calculate the year, month, week, and number of days between two dates:
The code
The time stamp of the ABAP transparent table, the data type is Dec:There is a requirement: Calculate the number of days between these two timestamps, discard the timestamp year-month-day 8 digits after the hour: minutes: seconds.For example: If the
Php calculation time difference/number of days between two time and date, hour, minute, second. & lt ;? Php? Function? Timediff (? $ Begin_time ,? $ End_time ?)? {????? If? (? $ Begin_time? & Lt ;? $ End_time ?)? {?? Php calculates the time
Here I despise Baidu, and every one of the results I want ... Finally, it was made with Google. Recently need oneself later study slowly 1. Gets the current month for how many daysNscalendar *calendar = [Nscalendarcurrentcalendar];Nsrange range =
PHP gets the number of days specified in the specified month
A very useful PHP function that was suddenly discovered when I wrote the interface recently, here to share:
Cal_days_in_month (Calender, $month, $year);
Calender: Calendars, constants,
C #
1: Get the number of days of the specified monthInt Days = DateTime. DaysInMonth (Year, Month); // Year indicates the Year and Month indicates the Month.2: Number of days in the current monthInt idate = System. DateTime. DaysInMonth (System.
From: http://blog.csdn.net/sproy/article/details/6505144
The new date ("xxxx/XX/xx") Construction Method in Javascript has a wonderful effect. When you input "xxxx/XX/0" (0) the date obtained is the last day of the previous month of the month (the
package com.datedaycha; import java.text.simpledateformat; import java.util.Calendar; import java.util.Date; import com.sun.org.apache.xerces.internal.impl.xpath.regex.parseexception; / * * java determine the number of days
One: Calculate the number of days difference between two dates
The code is as follows
Copy Code
var s = (new Date (ParamObj.end_date.replace (/-/g, "/"))-(new Date (ParamObj.start_date.replace (/-/g, "/")));var day = s/10
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.