SQL Server has a very powerful function: DATEPART ()It can calculate that 2017-10-17 is part of this year'sDay of the week: Select DatePart (dy, ' 2017-10-17 ')Week: Select DatePart (wk, ' 2017-10-17 ')First month: Select DATEPART (mm, ' 2017-10-17 '
Oracle and Mysql time formatting 1. Oracle formatting time: Oracle obtains the current date and Date Format
Get system date: SYSDATE () format Date: TO_CHAR (SYSDATE (), 'yy/MM/DD HH24: MI: SS) or TO_DATE (SYSDATE (), 'yy/MM/DD HH24: MI: SS) format
Again to the last day of the year, give yourself a summary, and then for the new Year, oh no, should be the next few years set a goal. Life can not always be like this only look at the present, must be for the long-term plan, otherwise always feel
SQL Server Date and Time Processing set
When the convert date conversion format is 20 or 120, the resulting string does not contain milliseconds.For example, select convert (varchar (23), getdate (), 120 or 20)21:46:43
When the date conversion
MySQL common time function 1.1 get current date + time (date + time) function: now () 1.2 get current date + time (date + time) function: sysdate () the datetime function is similar to now (). The difference is that now () is obtained at the
One, SQL Server time Date function detailed1. Current system date, timeSelect GETDATE ()2. DateAdd returns a new datetime value based on adding a period of time to the specified dateExample: Add 2 days to the dateSelect DATEADD (day,2, ' 2004-10-15 '
ObjectiveThe previous article wrote "How is SimpleDateFormat safe to use?" , which describes how SimpleDateFormat handles date/time, and how to ensure thread safety, and describes the DateTimeFormatter class, which is the default thread-safe for
ASCII (str) returns the ASCII value of the first character of the string str (0 if str is an empty string) mysqlgt; selectASCII (
ASCII (str) returns the ASCII value of the first character of the string str (0 if str is an empty string) mysqlgt;
ASCII (str)Returns the ASCII value of the first character of the string 'str' (0 is returned when 'str' is an empty string)Mysql> selectASCII ('2 ');-> 50Mysql> select ASCII (2 );->50Mysql> select ASCII ('dete ');-> 100ORD (str)If the string 'str'
1. conversion functionsThe biggest relationship with the date operation is the two conversion functions: to_date (), to_char ()To_date () converts the character type to the date type in a certain format:Specific usage: to_date ('1970-11-27 ',
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.