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 Full Date Time checkDaysbetween Date Days Bad
---------------------------------------------------//Judgment Leap Year//-------------------------------------------------- -Date.prototype.isLeapYear = function () {return (0==th
Comparison Date Difference
Date.prototype.toString date-to-spin string
Date.prototype.toArray date split to an array
Date.prototype.DatePart A partial information about the date
Date.prototype.MaxDayOfDate the maximum number of days from the month in which the date was taken
Date.prototype.WeekNumOfYear Determine the week of the year in which the date is
stringtodate string to date
isvaliddate validation Date validation
checkdatetime full date time check
Daysbetween date days bad
JS Code:
VB. Date-time conversion in net
Just learn vb.net soon, in doing a few small examples when found often to the date time and the conversion between the string, now sorted as follows, if there is not the right place please point out.
1. Conversion between character type and date type
The conversion of date type to character type is the simplest and can be directly converted. Dim dt as Date = NowDebug.WriteLine ("DT". tolongdatestring = "+ dt". tolongdatestring)Debug.WriteLine ("DT". tolongtimestr
1. Build your own two different SQL to complete the same query, note the impact of result set reuse on SQL performance
Four heroes: Alan Leonarding Sun XY
Story: These 4 small partners just graduated, after graduation all smoothly found the work, now has worked for six months, once they get together, because of vanity drive they want more than a salary, everyone is learning it, so they made a leo_ Salary table to calculate their average salary for the past six months!
Created Leo_salary table
Label:1. Conversion functionThe most significant relationship with the date operation is two conversion functions: To_date (), To_char ()The To_date () function converts a character type to a date type in a certain format:Specific usage: to_date (' 2004-11-27 ', ' yyyy-mm-dd '), the former is a string, the latter is a conversion date format, note, before and after the two to a corresponding.such as; To_date (' 2004-11-27 13:34:43 ', '
. 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.Date. prototype. WeekNumOfYear determine the week of the year where the Date is locatedStringToDate string to date typeIsValidDate verification date validityCheckDateTime full Date and Time checkD
Date.prototype.toString date to string Date.prototype.toArray The date is split into an array Date.prototype.DatePart partial information for the date Date.prototype.MaxDayOfDate the maximum number of days in the month in which the date is taken Date.prototype.WeekNumOfYear Determine the week ordinal of the year stringtodate string to date type Isvaliddate validation date validity checkdatetime full datetime check daysbetween date days difference JS code://------------------ -------------------
Script Library method list
Date.prototype.isLeapYear judgment Leap year Date.prototype.Format date format Date.prototype.DateAdd Date calculation Date.prototype.DateDiff Comparison Date Difference Date.prototype.toString date-to-string Date.prototype.toArray date split array Date.prototype.DatePart
Take a part of the date Date.prototype.MaxDayOfDate the maximum number of days of the month Date.prototype.WeekNumOfYear the date of the year Stringtodate string to date type Isvaliddate Vali
Date.prototype.DatePart the partial information of the date Date.prototype.MaxDayOfDate the maximum number of days from the month in which the date is taken Date.prototype.WeekNumOfYear To determine the week of the year in which the date is located Stringtodate string Date type Isvaliddate validation date validation Checkdatetime full date time check Daysbetween date days difference
---------------------------------------------------//Judgment Leap Year//---------------------------
-string Date.prototype.toArray date split array Date.prototype.DatePart Take a part of the date Date.prototype.MaxDayOfDate the maximum number of days of the month Date.prototype.WeekNumOfYear the date of the year Stringtodate string to date type Isvaliddate Validation Date validity checkdatetime Full date time check daysbetween date days difference JS code://------------------------------------------------ ---//judgment leap Year//---------------------------------------------------Date.prototyp
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 Full Date Time checkDaysbetween Date Days Bad
JS Code:
Of course, there are a number of later additions to the function you can choose according to
-------------------
Date.prototype.Format date format
Date.prototype.DateAdd Date Calculation
Date.prototype.DateDiff Comparison Date Difference
Date.prototype.toString date-to-spin string
Date.prototype.toArray date split to an array
Date.prototype.DatePart A partial information about the date
Date.prototype.MaxDayOfDate the maximum number of days from the month in which the date was taken
Date.prototype.WeekNumOfYear Determine the week of the year in which the date is
stringtodate string to date
isvali
Turn from: http://my.oschina.net/beer/blog/29832
Date Time Script Library method list Date.prototype.isLeapYear judgment Leap year Date.prototype.Format date format Date.prototype.DateAdd Date calculation Date.prototype.DateDiff Comparison Date Difference Date.prototype.toString date-to-string Date.prototype.toArray date split array Date.prototype.DatePart
Take a part of the date Date.prototype.MaxDayOfDate the maximum number of days of the month Date.prototype.WeekNumOfYear the date of the yea
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), GETDATE (), 111)://YYYY/MM/DDSelect CONVERT (varchar), GETDATE (),//YYYYMMDD):Second: JS in the Datatime1. Build t
ORACLE converts data between milliseconds and dates, and oracle converts data between milliseconds.
Convert millisecond to date
SELECT TO_CHAR(1406538765000 / (1000 * 60 * 60 * 24) + TO_DATE('1970-01-01 08:00:00', 'YYYY-MM-DD HH:MI:SS'), 'YYYY-MM-DD HH24:MI:SS') AS CDATE FROM DUAL;
Date conversion in milliseconds
SELECT TO_NUMBER(TO_DATE('2014-07-28 17:12:45', '
'); -- date earlier than 30 days table_flag: = 0; -- Initial State 0, the target does not exist table_name_1: = 't_emp_dept '| date_cur; --- if a temporary table exists, clear the table first and then kill the table (for function reuse) execute immediate 'select count (*) from user_tables where table_name = ''' | table_name_1 | ''' into table_flag; if table_flag = 1 then execute immediate 'truncate table' | table_name_1; execute immediate 'drop table' | table_name_1; -- log details log_detail: =
number of days in the month where the Date is located. prototype. weekNumOfYear judge the week of the year in which the date is located StringToDate string to date type IsValidDate verify date validity CheckDateTime complete date time check daysBetween date day difference js Code ://-- ----------------------------------------------- // Determine a leap year // ----------------------------------------------------- Date. prototype. isLeapYear = function () {return (0 = this. getYear () % 4 (this
. toLocaleTimeString (); // obtain the current time myDate. toLocaleString (); // obtain 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. maxDayOf
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.