How to calculate the day of the week?Slowtiger published on 2009-11-19 08:42:00How to calculate the day of the week?--Caille (Zeller) formulaWhat is the day of the week in history? What day of the future is the week? With regard to this problem,
[Go to] obtain the first day of the current week, month, and quarter in MySQL on the last day. The last day of the current week, month, and quarter in MySQL is taken from: hideto. javaeye. comblog255816 the first day of the current week:
First, use your formula to compile a simple program:
Main ()
{Int year;/* year */
Intw;/* day of the week */
Scanf ("% d", & year );
W = (year-1) + (year-1)/4-(year-1)/100 + (year-1)/400 + 1) % 7;
Printf ("% d \ n", W );
Getch ();
}
Enter 1 during
--Caille (Zeller) formulaWhat is the day of the week in history? What day of the future is the week? With regard to this problem, there are many computational formulae (two general formulas and some piecewise formulas), the most notable of which is
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespacewyfclass{ Publicclasstools{/// ///get the first day of the week (first day of Sunday)/// /// /// Publicdatetime Getweekfirstdaysun (datetime datetime) {//Sunday
Obtain the date range of the week based on the time range of the week.Obtain the date range of the week according to the week
/*** Return the range of Weekly Times of a month in a certain year * @ param weeks Weekly Times * @ return the range of
Obtain the date of a week based on a week of a year. For example, if the start date is set to "Thursday" to "Friday" of the next week, you can refer to the following requirements when getting the JS date: Obtain the date of the week based on a week
PHP retrieves the first and last days of the week. // The first and last days of the week. $ date = new & nbsp; DateTime (); $ date-& gt; modify ('This & nbsp; week '); $ first_day_of_week = $ date-& gt; format ('Y-m-D'); $ date-& gt; modify PHP get
1 ORACLE mid-week related knowledge description 1.1 Date formatting functions To_char (X [,FORMAT]) : Press X toFORMATThe format is converted into a string. X is a date,FORMATis a format string that specifies the format in which X is
PHP gets the first and last day of the week
The first and last day of the week$date =new DateTime ();$date->modify (' this week ');$first _day_of_week= $date->format (' y-m-d ');$date->modify (' This week +6 days ');$end _day_of_week= $date->format
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.