Class FunDemo6{public static void Main (string[] args){test function getDaysSystem.out.println (GetDays (1992,4,20));System.out.println (Subdays (1999,1,5,2001,3,10));}determine if a leap yearpublic static Boolean isleap (int y){if (y%4==0&&y%100!=0|
Query Day:Select * from Table where = To_days (now ()); Select * from Table where =Query one week:Select * from Table where 7 Day Date (column_time);Query one months:Select * from Table where 1 MONTH Date (column_time);MySQL date and time
Date and Time functionsThis chapter discusses some functions that can be used to manipulate time values. See section 11.3, "Date and Time type" for valid formats for each time and date type with a range and a specified value.
The following example
?? Java technology was born on May 23 in 1995, a language that has dominated the programming world for a long time and has the best ecosystem at first was the product of a failed set-top box project by Sun Microsystems (Microsystems). The first
Mysql> SELECT something from Tbl_name
WHERE To_days (now ()) –to_days (date_col)
DayOfWeek (date)
Returns the week index of date (1 = Sunday, 2 = Monday, ...). 7 = Saturday). Index values are compliant with ODBC standards.
mysql> SELECT DayOfWeek ('
The following query selects the records for all date_col values within the last 30 days.
Mysql> SELECT something from Tbl_name
WHERE To_days (now ())-To_days (Date_col) DayOfWeek (date)
Returns the week index of date (1 = Sunday, 2 = Monday, ...). 7
Ben ma special stamps? Sheet? What are the special stamps of the famous Chinese classical literature-Romance of the Three Kingdoms? Special Stamps on weizhen xiaoyaojin's famous Chinese classical literature-"Water Margin? Xu ningjiao's "Geng Wu Nian"
JS Get Current date time + date validation + judgment leap Year + date difference + date formatting +js Judging How many days a certain monthString to date type +js current datetime + date validation + judgment leap Year + date difference + date
Here is an example of using a date function. The following query selects records for all Date_col values within the last 30 days.Mysql> SELECT something from Tbl_nameWHERE To_days (now ()) –to_days (date_col) DAYOFWEEK (date)Returns the week index
(i) Date and time functions
1.DATE
Purpose: Returns the serial number that represents a specific date.
Syntax: Date (year, month, day)
Parameters: Year, for one to four bits, the parameter is interpreted according to the date system used. By default,
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.