Processing of numbers by Oracletrunc () and round () Functions
Processing numbers by Oracle trunc () and round () Functions
1. TRUNC Function
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 this function is as follows:TRUNC (TO_DATE ('24
The following summarizes the implementation methods for obtaining a specified date in Java. For more information, seeCopy codeThe Code is as follows:Format a Date String --> Date or Data --> String
SimpleDateFormat sdf = new SimpleDateFormat ("yyyy-MM-dd ");Date date = sdf. parse ("2009-11-04"); // String --> Date
String sdate = sdf. format (date ); // Data --> String ======================================== ==================================Package c
). ToShortDateString ();//Last day It 's easier to use ToString's character formatting in C #DateTime.Now.ToString ("yyyy-mm-01");DateTime.Parse (DateTime.Now.ToString ("yyyy-mm-01")). AddMonths (1). AddDays (-1). ToShortDateString ();Last month, minus one monthDateTime.Parse (DateTime.Now.ToString ("yyyy-mm-01")). AddMonths (-1). ToShortDateString ();DateTime.Pa
Oracle Time Difference Calculation
Two Date fields: START_DATE, END_DATE, calculate the time difference between the two dates (by day, hour, minute, second, millisecond): Day: ROUND (TO_NUMBER (END_DATE-START_DATE )) hour: ROUND (TO_NUMBER (END_DATE-START_DATE) * 24) minute: ROUND (TO_NUMBER (END_DATE-START_DATE) * 24*60) Second: ROUND (TO_NUMBER (END_DATE-START_DATE) * 24*60*60) millisecond: ROUND (TO_NUMBER (END_DATE-START_DATE) * 24*60*60*1000) Two Date type fields: START_DATE, END_DATE: cal
ASP. NET 2.0 improves the Data Binding operation in the template. It simplifies the Data Binding syntax databinder. eval (container. dataitem, fieldname) in v1.x to eval (fieldname ). The eval method, like databinder. Eval, can accept an optional formatted string parameter. Shortened eval syntax and databinder. the difference between Eval is that Eval will automatically parse fields based on the dataitem attribute of the most recent container object (such as datalistitem), while databinder. eval
(1) in the English version of Oracle, the default date format is ' Dd-mon-yy ', such as ' 01-jan-98 '
The Oracle default date format in Chinese version is ' Day-month-year ', for example ' 2 January-August-2003 ' or ' 2 January-August-03 '
(2) Convert string to date
Using Oracle Internal Functions to_date ()
The parameter of the To_date () function is the inversion of the To_char () function argument.
To_date (string_value, Date_format)
The variables are defined as follows:
String_value:
There are several scanning methods under Oracle 10g, note that the last scanning method, when the partition column is calculated, will not walk the partition, which is calculated with the index column will result in the same as the index.--Scan individual partitions PARTITION RANGE single--Continuous scanning of multiple partitions PARTITION RANGE ITERATOR--Non-sequential scanning of multiple partitions PARTITION RANGE inlist--Scan all partitions PARTITION RANGE allsql> drop table T_range purge;
To_date (' 2007-06-28 19:51:20 ', ' yyyy-mm-dd HH24:mi:ss ') from dual;In general sql:Select To_date (' 2007-06-28 19:51:20 ', ' yyyy-mm-dd HH:mm:ss ') from dual;Difference:1, HH modified to HH24.2, minutes of mm modified to MI. The 24-hour format shows up with HH24. Select To_char (sysdate, ' Yyyy-mm-dd HH24:mi:ss ') from dual; Select To_date (' 2005-01-01 13:1
same thing, a week is 7 days, last week is this week minus 7 days, and next week is the sameDateTime.Now.AddDays (Convert.todouble (0-convert.toint16 (DateTime.Now.DayOfWeek))-7). ToShortDateString ();DateTime.Now.AddDays (Convert.todouble (6-convert.toint16 (DateTime.Now.DayOfWeek))-7). ToShortDateString ();Next weekDateTime.Now.AddDays (Convert.todouble ((0-convert.toint16 (DateTime.Now.DayOfWeek)) + 7). ToShortDateString ();DateTime.Now.AddDays (Convert.todouble ((6-convert.toint16 (DateTime
(DateTime.Now.DayOfWeek)]; //last week, the same thing, a week is 7 days, last week is this week minus 7 days, and next week is the sameDateTime.Now.AddDays (Convert.todouble (0-Convert.ToInt16 (DateTime.Now.DayOfWeek))-7). ToShortDateString (); DateTime.Now.AddDays (convert.todouble (6-Convert.ToInt16 (DateTime.Now.DayOfWeek))-7). ToShortDateString (); //next weekDateTime.Now.AddDays (Convert.todouble (0-Convert.ToInt16 (DateTime.Now.DayOfWeek)) +7). ToShortDateString (); DateTime.Now.Ad
(DateTime.Now.DayOfWeek)]; //last week, the same thing, a week is 7 days, last week is this week minus 7 days, and next week is the sameDateTime.Now.AddDays (Convert.todouble (0-Convert.ToInt16 (DateTime.Now.DayOfWeek))-7). ToShortDateString (); DateTime.Now.AddDays (convert.todouble (6-Convert.ToInt16 (DateTime.Now.DayOfWeek))-7). ToShortDateString (); //next weekDateTime.Now.AddDays (Convert.todouble (0-Convert.ToInt16 (DateTime.Now.DayOfWeek)) +7). ToShortDateString (); DateTime.Now.Ad
same thing, a week is 7 days, last week is this week minus 7 days, and next week is the sameDateTime.Now.AddDays (Convert.todouble (0-convert.toint16 (DateTime.Now.DayOfWeek))-7). ToShortDateString ();DateTime.Now.AddDays (Convert.todouble (6-convert.toint16 (DateTime.Now.DayOfWeek))-7). ToShortDateString ();Next weekDateTime.Now.AddDays (Convert.todouble ((0-convert.toint16 (DateTime.Now.DayOfWeek)) + 7). ToShortDateString ();DateTime.Now.AddDays (Convert.todouble ((6-convert.toint16 (DateTime
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.