the date and time
Date and Time script library method list
Date. prototype. isLeapYear determines the Date of the leap year. prototype. format Date. prototype. dateAdd Date calculation Date. prototype. dateDiff compares the Date difference. prototype. toString Date to string Date. prototype. toArray Date is split into array Date. prototype. datePart obtains part of the Date information. prototype. maxDayOfDate is the maximum number of days in the month where the Date is located. prototype. week
----------------------------------
SELECT * from Nls_database_parameters;
The result is the following table: Nls_date_format in the table represents the date format.
PARAMETER VALUE
----------------------------------- -----------------------------------
Nls_language American
Nls_territory AMERICA
Nls_currency $
Nls_iso_currency AMERICA
Nls_numeric_characters.,
Nls_characterset ZHS16GBK
Nls_calendar Gregorian
Nls_date_format DD-MON-RR
Nls_date_language American
Nls_sort BINARY
Nls_time_forma
formatDATE.PROTOTYPE.DATEADD Date CalculationDate.prototype.DateDiff Comparison Date DifferenceDate.prototype.toString Date-turn stringDate.prototype.toArray date split into arraysDate.prototype.DatePart some information about the dateDate.prototype.MaxDayOfDate the maximum number of days of the month from which the date is takenDate.prototype.WeekNumOfYear the first weeks of the year in which the date is judgedStringtodate String Turn Date typeIsvaliddate Validation Date ValidityCheckdatetime
Security | The network carefully observes the intercepted Httptunnel packet, and finds that the first packet followed by a three-time handshake contains a post action that is sent by HTC (client side) to the HTS (server side). As follows: 14:55:39.128908 client.yiming.com.51767 > Server.yiming.com.80:s 3521931836:3521931836 (0) win 8760 (DF)
0x0000 4500 002c d3cc 4000 fb06 53c9 xxxx xxxx E.,.. @... S.. f.#
0x0010 yyyy
script library of date and time. prototype. isLeapYear determines the Date of the leap year. prototype. format Date. prototype. dateAdd Date calculation Date. prototype. dateDiff compares the Date difference. prototype. toString Date to string Date. prototype. toArray Date is split into array Date. prototype. datePart obtains part of the Date information. prototype. maxDayOfDate is the maximum Date of the month in which the Date is located. prototype. weekNumOfYear judge the week of the year in
Time Calculation of common Oracle computing statements: oracle two time subtraction by default is the number of days * 24 is the number of hours of difference oracle two time subtraction by default is the number of days * 24*60 is the difference in minutes oracle two the default value of time subtraction is the number of days * 24*60*60, which indicates the number of seconds. -- MONTHS_BETWEEN (date2, date1) Given the date2-date1 of the month SQL> select months_between ('19-December-111111', '19
Date calculation
Date. prototype. DateDiff compare Date difference
Date. prototype. toString Date to string
Date. prototype. toArray Date is split into Arrays
Date. prototype. DatePart obtains part of the Date information.
Date. prototype. MaxDayOfDate indicates the maximum number of days in the month where the Date is located.
Date. prototype. WeekNumOfYear determine the week of the year where the Date is located
StringToDate string to date type
IsValidDate verification date validity
CheckDate
results
SQL> select to_date ('2017-11-12 12-07-32 ', 'yyyy-mm-dd hh24-mi-ss') value from dual;
VALUE
-------------------
2004.11.12 12:07:32
SQL> select to_date ('20140901') value from dual;
VALUE
-------------------
2004.10.15 00:00:00
SQL> select to_date ('20140901') value from dual;
ERROR is located in row 1st:
ORA-01861: Text and format strings do not match
Sysdate current date and time
SQL> select sysdate value from dual;
VALUE
-----------
Find several processing methods for date functions, and sort them into favorites for verification.
Date. prototype. isLeapYearDate. prototype. FormatDate. prototype. DateAdd Date calculationDate. prototype. DateDiff compare Date differenceDate. prototype. toString Date to stringDate. prototype. toArray Date is split into ArraysDate. prototype. DatePart obtains part of the Date information.Date. prototype. MaxDayOfDate indicates the maximum number of days in the month where the Date is located.Da
Processing date in Oracle
To_date formatDay:Dd number 12Dy abbreviated FriDay spelled out FridayDdspth spelled out, ordinal twelfthMonth:MM number 03Mon abbreviated MARMonth spelled out MarchYear:YY two digits 98Yyyy four digits 1998
The time range in the 24-hour format is: 0:00:00-23:59:59 ....The time range in the 12-hour format is: 1:00:00-12:59:59 ....1.Date and character conversion function usage (to_date, to_char)
2.Select to_char (to_date (222, 'J'), 'jsp ') from dual
Display two hundred
The above is reprinted, and most of them are not verified.
Select trunc (sysdate, 'dd') from dual. The result is: 12:00:00, which is different from the following!
Oracle trunc () function usage
1. trunc (for dates)The date value intercepted by the trunc function for the specified element.The syntax format is as follows:Trunc (date [, FMT])Where:Date: A date value.FMT date format, which is truncated by the specified Element format. Ignore it and it is intercepted by the latest date.The usage of
Date field: SQL Server Date field format in the same character field format, that is, a single quotation mark on it, Oracle Date field format is different, it is very wordy, there are only two ways to deal with:
A: Add a single quotation mark to its value. The arrange order format for year, month, day, time, and division must be consistent with Oracle's current date-type data format (the default format for Oracle Chinese date data is: Dd-mon-yyyy, as
Oracle Two-time subtraction default is days
Oracle Two-time subtraction default is the number of days *24 to the difference in hours
Oracle Two-time subtraction the default is the number of days *24*60 to the difference in minutes
Oracle Two-time subtraction the default is the number of days *24*60*60 to the difference in seconds
--months_between (DATE2,DATE1)Give out the month of date2-date1Sql> Select Months_between (' 1 September-December-1999 ', ' 1 September-March -1999 ') Mon_between from
Label:http://blog.csdn.net/redarmy_chen/article/details/7351410 Oracle Two time subtraction default is the number of days Oracle two time subtraction The default is the number of days *24 is the difference between the hours Oracle two time subtraction The default is the number of minutes *24*60 is the difference between Oracle two time subtraction default is the number of days *24*60*60 is the difference in seconds --months_between (DATE2,DATE1)Give the month of date2-date1Sql> Select Months_be
Processing date in Oracle
To_date formatDay:Dd number 12Dy abbreviated FriDay spelled out FridayDdspth spelled out, ordinal twelfthMonth:MM number 03Mon abbreviated MARMonth spelled out MarchYear:YY two digits 98Yyyy four digits 1998
The time range in the 24-hour format is: 0:00:00-23:59:59 ....The time range in the 12-hour format is: 1:00:00-12:59:59 ....1.Date and character conversion function usage (to_date, to_char)
2.Select to_char (to_date (222, 'J'), 'jsp ') from dual
Display two hundred
Processing date in Oracle
To_date formatDay:Dd number 12Dy abbreviated FriDay spelled out FridayDdspth spelled out, ordinal twelfthMonth:MM number 03Mon abbreviated MARMonth spelled out MarchYear:YY two digits 98Yyyy four digits 1998
The time range in the 24-hour format is: 0:00:00-23:59:59 ....The time range in the 12-hour format is: 1:00:00-12:59:59 ....1.Date and character conversion function usage (to_date, to_char)
2.Select to_char (to_date (222, 'J'), 'jsp ') from dual
Display two hundred
arraysDate.prototype.DatePart Partial information of the date takenDate.prototype.MaxDayOfDate the maximum number of days in the month in which the date is takenDate.prototype.WeekNumOfYear the week of the year in which the date is judgedStringtodate String to date typeIsvaliddate Verifying date ValidityCheckdatetime Full date and time checkDaysbetween Date Days DifferenceJS Code://---------------------------------------------------Judging leap years//-------------------------------------------
Machine (including microseconds and time zones). It has nothing to do with the time zone of the session.
Select distinct imestamp from dual result: 24-12-13 07.34.37.042000 PM +
2. Difference between two dates
Two dates can be directly added or subtracted. The returned value is in the unit of day. You can also use a date to add or subtract a value to represent N days (Before)
For example, if I pay after ten days, what is the day after ten days?
Select sysdate + 10 from dual result: 19:38:19
For
Practical casesFor the January 2015 to 12 months, the total number of people and the actual number of people from January 2014 to 12 months of the previous year have been found, and no month has shown a population of 0. Similar effectsCreate a tableCREATE TABLE personsituation ( ID number not null, rdate DATE, nums number )Inserting dataINSERT into personsituation (ID, rdate, nums) VALUES (1, to_date (' 26-01-2015 ', ' dd-mm-yyyy '), and 131);
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.