(Click the public number above for a quick follow-up)
Compilation: Bole online-WRM, English: code.facebook.com
If you have a good article to submit, please click here to learn more
Over time, the software industry has come up with several ways to
1.TRUNC (for dates)
The date value that the Trunc function truncates for the specified element.
Its specific syntax format is as follows:
TRUNC (Date[,fmt])
which
Date value
FMT the date format, which is truncated by the specified element
First, use Select to retrieve dataData query is the central content of SQL language, the function of the SELECT statement is to allow the database server to retrieve the required information according to customer requirements, and in accordance with
This article focuses on the detailed usage examples of to_date in Oracle, including the use of period and character conversion functions, string and time conversions, the day of the week, the number of days between two dates, and the use of
---------------------------------------------Date/Time function-------------------------------------------------1:sysdateThe current date used to get the systemSELECT sysdate from DUAL;--2:add_monthsAdd or subtract a monthSELECT To_char (add_months (
--Get the current date (for example: YYYYMMDD)Select CONVERT (nvarchar), GETDATE (), 112)--Get the current date (for example: YYYYMMDD hh:MM:ss)Select GETDATE ()--Get the current date (for example: YYYY-MM-DD)Select Datename (Year,getdate ()) + '-' +
Use of the Oracle trunc () function1.TRUNC (for dates)The date value that the Trunc function truncates for the specified element.Its specific syntax format is as follows:TRUNC (Date[,fmt])whichDate a datetime valueFMT date format, which is truncated
1.1trunc function handles numbersThe TRUNC function returns the processed value, and its working mechanism is very similar to the round function, except that the function does not make the corresponding rounding selection processing of the specified
These four functions are a bit like the functions in Java, first of allTrunc (Number,[decimals]) This function is similar to the Intercept functionNumber: Indicates that you want to enterDecimals (decimal): Indicates the number of digits you want to
Oracle queries the month for how many days, the code is as follows:Select To_number (Add_months (trunc (' 2014-11-4 11:13:53 ', ' yyyy-mm-dd hh24:mi:ss '), ' mm '), 1)-Trunc (' To_date (' 2014-11-4 11:13:53 ', ' yyyy-mm-dd hh24:mi:ss '), ' mm '))
One: Datatime in SQL1. Between and equals >= and 2. Commonly used methods of querying datatime into stringsSelect CONVERT (varchar), GETDATE (), at $)://YYYY-MM-DDSelect CONVERT (varchar), GETDATE (), ()://Yyyy-mm-dd HH:MM:SSSelect CONVERT (varchar),
Reference:http://www.cnblogs.com/coconut_zhang/archive/2009/02/02/1382598.htmlHttp://blog.itpub.net/14766526/viewspace-1156100/Select GETDATE () as ' current date ',Datename (Year,getdate ()) as ' year ',Datename (Month,getdate ()) as ' month
I. Oracle COMMON data typesOne, data definition language (DDL)Data definition language is used to alter the database structure, including creating, changing, and deleting database objects.The data definition language commands used to manipulate the
Oracle Common Functions--trunc,to_date,to_char,to_number, SUBSTR,REPLACE,NVL, Trim,wm_concat,upper, Lower,length,add_months ( sysdate,1)View Oracle Version: SELECT * from V$version First, trunc function1, TRUNC (for dates) The date value that the
We may encounter scenarios in which a program on a Linux server must be timed out on every weekday. So is there a way to implement this function? The answer is yes. We can use shell scripts to simply implement this function.The rationale is simple:
Js method for obtaining time functions and extended functions built-in Date functions
Var mydate = new Date ();Mydate. getYear (); // obtain the current year (2 digits)Mydate. getFullYear (); // obtain the complete year (4 bits, 1970 -????)Mydate.
Javascript Event Query is comprehensive. For more information, see. Click () object. click () enables the object to be clicked.
Whether the closed object window has been closed; true/false
ClearTimeout (object) clears the set setTimeout
1. Java Gets the current time1 //Import2 Importjava.util.Date;3 ImportJava.text.DateFormat;4 ImportJava.text.SimpleDateFormat; 5 6 7Date dt=NewDate ();//If no format is required, the current system time can be used directly with Dt,dt8DateFormat
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.